They are very cagey about how the lottery system works. This is MY understanding of the process from everyone I've spoken to/what I've seen online, but it might not be totally accurate, so take it with a grain of salt
People accepted early decision, accepted into a scholarly concentration program, and those with certain scholarships are placed at campuses first. Then, everyone else gets placed. They don't rank students, students rank the campuses. Then it is a "random" lottery but from what I've heard, its based on the time you were accepted. For example, they'd take everyone who was accepted in Oct/Nov and hadn't been placed yet and put them in a pool. Then they places everyone as best they can according to submitted ranking list and number of spots left at each campus. Then, they would repeat for eveyone accepted Dec/Jan/Feb, then March/April. Once a campuses spots have been filled, nobody else can be placed at that campus. For waitlist spots, if someone withdraws the person who takes their spot is automatically assigned to the campus they withdrew from.