"How many stars are in the Milky Way?"
Translation:Hoeveel sterren zijn er in de Melkweg?
In this case you can view 'er' as a place. So you can read it as 'How many stars are 'there' in the MIlky Way?' There are four different functions of 'er', but in this sentence it's used as a place. Hope you understand it and you cannnot leave 'er' out.