Why do two people who hate each other in the beginning end up together in the end?

Maybe this is only in the movies, but how come the two main characters act like they hate one another in the beginning by insulting them, not getting along etc?

Why do two people who hate each other in the beginning end up together in the end?
Post Opinion