Firstly, I am not specifically talking about PhD supervision. I think that's less relevant for my question since a PhD supervision is usually a mutually beneficial arrangement, as the professor gains a PhD student to help them with related research.
My focus is more on supervision of bachelor and masters theses. In these, there is less benefit to the professor to act in a supervisory role.
So with that in mind, if a student contacts a professor because they need a supervisor for their bachelor or thesis project (something which is a requirement in order to get the degree), is the supervisor obligated to accept this role?
I don't think the answer is yes, since people usually say that if you want to get a supervisor, you should ask your professior if he/she wants to. So the words imply that the professor has a choice and could turn you down.
And so if the answer is indeed no, how does the system then work? What happens if nobody wants to supervise one particular student? Is that student then just screwed?