I've just been reading the aforementioned documents and a ton of words are capitalized. Why exactly is this?
They aren't quite random, although it may appear so to us. In the 18th Century capitalisation was used for proper nouns like names, which we still use today: France, Fred, Ford, etc. However, they also capitalised anything they wanted to make special note of, particularly nouns or nouns under discussion. So if we look at the last sentence from the US Declaration of Independence we can see exactly what the authors were emphasising:
We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these united Colonies are, and of Right ought to be Free and Independent States; that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish Commerce, and to do all other Acts and Things which Independent States may of right do. And for the support of this Declaration, with a firm reliance on the protection of divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.
We can see some interesting things going on here. For instance, we can see that they are establishing their rights to declare independence: they are Representatives, legally Assembled, appealing to the Supreme Judge, in the name of the People. They claim their rights as Free and Independent States with the power to conduct War or Peace, enter Alliances and establish Commerce.
Also of note is that in this sentence they don't consider the United States of America as a proper name. Instead they write the united States of America. 'United' is used as a description here, not a part of a proper name.
My source is the Cambridge Guide to English Usage, which also notes that 'this practice survives in some extent in legal documents, which still use more capital letters than any other texts, partly perhaps to provide a focus for the reader in long legal sentences.'