I interviewed with some random company a few years ago, I don't even remember what they did but I know they didn't pay all that well. Passed the technical, and then I needed to 5 seper calls with everyone from marketing to the CTO. Apparently they all had equal weight and I answered some question more vaguely then they'd have liked, and I got an automated rejection. Had CC everyone before I got an answer as to what the problem was. Your shot doesn't only need to be perfect, it needs to be perfect while shooting into the darkness with no glasses on.
Sometimes the dice roll is front-loaded and you happen to sail through, match the vibes, nail the technical, and the second technical, and use AI as much as they want in your workflow, and on and on
What's closer to an actual lottery is getting your resume picked. Than you get to study and participate in the blind dog race
You can ace an interview and not get hired.
If two friends with identical levels of experience in the same technology interviewed at two different arbitrary companies, both saying they performed well, but one gets the job and the other doesn't, it would be hard to say in which way performance was measured, or even how many people they'd speak to before being rejected or accepted. More often than not, nobody can or will tell them. Sometimes there's an objective measure of success in the technical step, sometimes there's not. Sometimes you think you had good chemistry because the conversation flowed fine, and you then get hit with a rejection, and it might have been that someone else got luckier than you that day, got a better sleep, answered one out of 50 questions between all interviewers in a way that was what the interviewer was looking for, went to a school that the interviewer liked instead of another one, etc..
Whether it's truly "entirely" random or not isn't the point, the point is that along with being able to demonstrate the skills you say you have, it's a multi-step series of lucky rolls all the way to the end.
In some cases, you can actually ace the technical skills portion and all of the other portions, and they'll still pick someone else because of arbitrary prejudice.