The major difference between these two organizations (other than geography) is that the EU is essentially an attempt to create one big nation out of many nations in Europe while the UN is an organization that is trying to promote cooperation and peaceful relations (on a voluntary basis) between independent countries.
The EU is trying to create as much of a unified Europe as it can. It has created a set of rules that govern all countries within it. It has even created a single currency (the euro) that is used by many of its members.
The UN is not trying to create a world government. It does not try to get China and the US, for example, have the same currency or the same laws about labor or food safety or anything like that. Instead, it is simply an organization that gives various countries the chance to talk to one another so as to avoid conflict and generally improve the world. In an attempt to do this, it does have bodies that try to do things like promoting economic development, but it is not trying to make all its members obey a single set of rules.