the City was the earliest settlement, built by the Romans at the most convenient place for crossing the river, with a wall around it. It has been occupied more or less constantly for 2000 years, though it may have been abandoned for a while in the Dark Ages, when people seem to have lived further upstream near Aldwych. It is now the business centre, and mostly dead after dark. Westminster developed separately but became the royal city. They gradually spread into one metropolis from the middle ages, as spudqueen says. Too many people came to live there and they had to start living outside the old walls (of which there are still a few bits standing - you can see them in the Musum of London).
Westminster Abbey was an abbey (with an abbot and monks), not a cathedral. It too was originally founded by royalty rather than by the church. Westminster Cathedral is the much more recent Catholic building up the road.