How do you get HPV

I recently got genital warts. My boyfriend is the only person I've ever been with. I am confused on what HPV is and how I got it. Does it have to come from someone else(meaning my boyfriend). Or is it more of an Sti where it's just an infection that can come from being unsanitary or skin to skin contact? The doctors weren't giving me much information and the internet was kinda confusing. If anyone has an answer that would be great. I don't think my boyfriend has been with anyone else while we have been together but if anything it could have come from someone before me and I am showing symptoms late. Thank you!