What is a UTI?

Exactly what is it that causes a uti when a woman has too much sex?!? I've never had a uti but I hear they are awful and I just want to know what to do in case I ever do have one.