While there are many theories about its origin, the most accepted one is that it's a misspelling of "owned", meaning to completely defeat or dominate someone in a game or other competition.
Over time, "pwned" has evolved to have a broader meaning, often signifying any type of digital security breach or compromise, such as having your password leaked in a data breach.