Saw someone on Reddit earlier with a theory that the people that got snapped were sent to the Quantum Realm. That realm does something to people (like how Janet could suddenly heal Ghost), and reversing the snap brings people back to reality, but with abilities, and thus the X-Men can be a thing.