Because boron has a vaccant bond. Look all molecule wants to become stable. As boron has vaccant orbitle means it is unstable due to its vaccant orbital. And Nitrogen has lone pair so, he share it with boron then boron will no longer be unstable.
Just understand it by this example
Vaccant orbitle means the element oa hungry and lone pair means the element has extra food and house means molecule
Now in a house one memeber (nitrogen) has extra food (lone pair) and the other member(boron) is hungry (veccant orbital). So, as they live in same house(molecule). So, one member cant let the other memeber to remain hungry(veccant) so he will share his food(lone pair) with him. So, that they can remain peacefully and together.
I hope you got my point