The railway system doesn't release all tickets at once. First batch might be only 60-70% of seats. The rest release over days. Stations along the route each have their own allocation. If your station is sold out, another might still have seats.
The waitlist pulls from pooled reserves not shown during direct booking. Cancellations are matched automatically. The system optimizes to fill trains efficiently, not first-come-first-served.
If tickets sell out instantly, don't panic. Join the waitlist. Check periodically before departure. Consider booking from a bigger station. The system is designed to make tickets look scarce — knowing how it works gives you a fighting chance.