To keep it simple:
'near' means 'close' in the sense of not a long distance away.
'nearby' means 'close'' in the sense of handy, convenient.
I am staying with a friend in a town I have not visited before. I could say to my friend:
I have to buy some tablets. Is there a chemist near here?" (near where he lives, where I am staying.) that is, not far from the house.
I have to buy some tablets. Is there a chemist nearby? ( handy to where you live because I don't want to ask you to drive me half way across town to the nearest chemist.)
"The first day of my visit, we walked to a nearby pub for lunch." That is, the pub is handy to his home if he wants to slip down for a drink, or a meal.
The pub is handy, because it is near his home. That is, not far from where he lives.
He's bought a house in a lovely village. It has a huge garden, and there's a river nearby for swimming and boating.
That is, 'handy' for recreational purposes.
We've bought a house in a lovely village. It's near a school, so the children don't have to take a bus anymore. That is, the school is not far from the house.
"There's a school nearby, so the children don't have to travel far." That is, handy to where they live.
Can you see that 'near' is used when you are thinking how close or far something is.
'nearby' is used when you are considering whether a place is handy or convenient for you to get to. A shopping centre could be 5 miles away, but if you live next to a motorway, and the supermarket is also just off the motorway, then at 70 m.p.h , it is a matter of minutes away - very handy - whereas 5 miles across a town with heavy traffic and with traffic lights on every corner ...well, it may near, but it's not nearly as convenient if it takes 2 or 3 times as long to reach.