I don't understand why Prince Charles is called the Prince of Wales. From what I can find online, it seems it's a tradition for English monarchs to give their heir the title "Prince of Wales." But why? And why does Wales accept this? I would be furious if I were Welsh and some privileged English aristocrat held the title of the name of my country. Theoretically, could Wales do something to formally reject this?
The UK is a kind of constitutional monarchy, even if there is no written constitution. This combines the a ceremonial rule of the monarch as head of state, coupled with an elected official as the head of government. The elected officials are very polite about the traditional rights of the crown, even if actual power rests with the crown-in-partliament, i.e. the parliament while it gives respect to the ceremonial role of the monarch.
Six or eight centuries ago, Wales had no choice but to obey the English monarch. English soldiers made that point forcefully. Since then, most Welshmen seem to have accepted the situation. Getting rid of the crown would be relatively simple for a sovereign member of the Commonwealth, like Barbados, but less so for a part of the UK. It would probably set a new precedent if the Welsh wanted to become a republic as part of the United Kingdom, but I'm sure lawyers would find a way.
Historically, having the heir to the English throne use the title “Prince of Wales” was done specifically to endear him (and the English monarchy generally) to the Welsh. It’s unclear how well received this really was originally (the Welsh were not given much opportunity to voice honest opinions about it at the time), but it wasn’t meant to offend.
Specifically, King Edward I of England conquered the Principality of Wales, and the previous (Welsh) Prince of Wales, Llywelyn ap Gruffudd, was killed in the fighting. Since Edward I now controlled the Principality, and the prior Prince of Wales was dead, he controlled the title (and presumably could and would kill anyone else who tried to claim it, since that would effectively be a declaration of war).
Note that “Prince” in this case refers to the actual leader of the Principality, not to the son of any “King of Wales”—that title has never existed, because Wales was never a “kingdom.”¹ Using “prince” or “princess” to refer to the monarch’s children came several hundred years later, and that appears to have come about specifically because of the heir’s use of the Prince of Wales title. At the time a “prince” was always just the leader of a “principality.”
Technically, then and now, the title Prince of Wales belongs to the English/British monarch, not their heir. That is, if you’re asking who the prince (read: leader) of the Principality of Wales is, the answer then would have been Edward I and the answer at the time of writing would have been Elizabeth II. This tends to be true of pretty much all titles, really; children don’t “really” get those until they inherit upon a parent’s death. However, it is customary for nobility with multiple titles to allow their children to use some of their titles, as a way of keeping those titles prominent and not buried under a list of their own titles, as well as to add some prestige to their children. Consider: if the “Queen of The United Kingdom of Great Britain and Northern Ireland” just held onto all her titles and let her children just be Lord or Lady (the usual default in the absence of being allowed to use a title one’s parent isn’t using), you might forget all about Wales.
This was even more pronounced for Edward I, King of England, whose title made no reference the whole island of Great Britain which includes Wales (not least because he didn’t control the whole island; Scotland would remain an independent kingdom for a long time after his reign²). So after conquering the Principality of Wales and killing the previous Prince of Wales, Edward I intentionally made sure his wife was in Wales as she gave birth to his son and heir (who would go on to be Edward II), who he named Prince of Wales. It meant that Edward I was recognizing Wales as the most important part of his holdings after England itself. Having Edward II be born in Wales, and take that title, was supposed to mean he was (as good as) Welsh.³
For the record, some Welsh “kings” did exist, all prior to Edward I. None used “King of Wales” or “King of the Welsh,” specifically, though, nor was there a “Kingdom of Wales.” Their titles were either smaller and more specific, or else larger and more grandiose—“King of the Britons” was used by a few. More relevantly, none of these were recognized as such by England, while the Principality of Wales, as well as its Prince, was a thing that England recognized for a while before Edward I conquered it.
Not for lack of trying on Edward’s part, however.
Lest we forget, the current English royal family is mostly German by heritage. For that matter, Edward himself was largely French: his father’s family—via William the Conqueror—was from Normandy, and his mother was from Provence. So for Edward II to be “Welsh enough” wasn’t so much of a stretch.
The short answer to the question is the British monarchs give their first male heir the title 'Prince of Wales' because they are also the monarch (as phoog points out) of Wales.
Royal titles are not always confined to one nation; King James the VI of Scotland inherited the monarchy of England and became King James the First of England and there are many other examples of European royalty holding titles in more than one country. In this case however, England and Wales are one nation. The answer to this question explains the relationships between the home nations in terms of sporting representation.
Annexation to England
The Statute of Rhuddlan in 1284 provided the constitutional basis for a post-conquest government of the Principality of North Wales from 1284 until 1535/36. It defined Wales as "annexed and united" to the English Crown, separate from England but under the same monarch. The king ruled directly in two areas...
His son, the future Edward II, was born at Caernarfon in 1284. He became the first English Prince of Wales in 1301, which at the time provided an income from northwest Wales known as the Principality of Wales.
Subsequently, the laws of England were imposed upon Wales by Henry VIII under the Laws in Wales acts of 1535 and 1542. The Welsh language was banned but Wales was allowed parliamentary seats in Westminster.
'Theoretically, could Wales do something to formally reject this?' The current situation is that Wales elects MPs to the House of Commons at Westminster and MS to the Welsh Government (a devolved parliament that has more limited powers than Westminster). Republican sentiment is strongest in Plaid Cymru, the Welsh independence party, who currently hold thirteen of the sixty seats in the Sennedd. Plaid is not committed to removing the monarchy should they gain independence, rather it promises a referendum on the subject. If Plaid formed a government, gained independence and the referendum result was in favour of ditching the monarcy, then Wales could include that in its new constitution. Otherwise, the Welsh would have to rely on convincing the Westminster parliament that the situation should be changed.
The results of a poll from 2019 suggest that support for the monarchy outweighs opposition in all the Westminster parliamentary constituencies in Wales.