How does Backpropagation work?

F(X) = Y describes what a model does once it’s trained. But how does F gets to that state in the first place?