Making the spawner in the sky ensures that mobs will have only one place to spawn, and that’s inside of the spawner. The other thing to do is build the spawner on top of a body of water.