The difference between these two unions is that the United States is one country with a federal system of government while the European Union is a union of separate states which are all sovereign and which only have a confederal system of government holding them together.
The EU is, in many ways, a confederation. A confederation is a group of states that are all sovereign. When these states get together to create a central government (the EU), they give that central government certain powers. In the EU, this is accomplished through various treaties. The central government only has whatever powers the states give to that government. Any state may withdraw from the union at any time.
This is in contrast to the United States. The United States is not made up of sovereign states. The states of the US do not give power to the federal government and they do not tell the federal government what it can and cannot do. Instead, there is a Constitution that sets out the rights and powers of the federal government and of the states. The states cannot leave the union without permission.
Thus, the United States is one country that has a federal system while the EU is a group of countries that have created a confederal government that has some powers over all of them.