Vart implies direction, whereas var implies place.
Vart går farfar? = Where to is grandpa going?
Var är hatten? = Where's the hat?
In spoken or informal contexts they're often mixed though, so you might well hear one mean the other and vice versa. However, you should get to know the difference as it might come in handy.
I got lost about family names, so I found this video: https://www.youtube.com/watch?v=8fspzcZjtNc
It explains the differences between farmor/mormor, farfar/morfar etc.
I think there should be an explanation about this particularity of the Swedish language. I was told that Hungarian also distinguishes 4 forms of saying 'brother/sister', that's a lit bit unusual for us Western people.