Magic in the Cosmere all comes from Adonalsium or one of the shards.
Magic also all seems to have specific "Aspects" that it uses to function
Namely the four spiritual atributes
Connection
fortune
Investichure
Identity
And the ten surges
Adhesion
gravitation
division
abrasion
progression
ilumination
transformation
transportation
Cohesion
Tension
Most magic seen can be ascribed to combinations of these aspects for example Allomantic steelpushing is an application of gravitation via ones connection to metal or potentially the investitures connection to metal.
A reader experienced in knowledge of the Cosmere will wonder why there are only fourteen aspects that magic draws upon when the Cosmere's number of choice is sixteen, it is the opinion that more will be revealed by the release of Dragonsteel but that the remaining two aspects have something to do with the unexplained magic such as allomantic soothing which seems to use connection, but how specifically that relates to manipulating emotions is unclear at this time.
Other factors can influence magic without themselves being how the magic operates(though they usually play a part of the use of magic)
Namely
Intent
Perseption
these two are the cause of much of Cosmere magic's operation as what one intends to happen usually does. This is explicate in AonDor as such vague one word terms would be easily misinterpreted without intent playing it's part.
Other such factors are
Shape
Color
Weather
Shardaic filtering
Shape is again manifested best in AonDor, but allomancy gains it's power from the shape of metals atomic structure, and it is because of this that Booknerd inc's Cosmere division has developed the theory that Aluminum's structure is similar to a drain causing it to be almost impossible to affect with magic due to magic used on it to be siphoned away, where it goes is still unknown.
Color is best revealed to affect magic on Nalthis with Awakening, but it also play's into other shards having their own color scheme and Orders of Knights Radiant having their colors as well.
Weather is Shown best on Roshar as affecting Magic with both the Highstorm and the Everstorm acting as wells of investiture, the Mists of Scandrial also serve this purpose.
Within the Cosmere one must be aware of a few things magic can't do, or is limited in.
Foresight is severely limited in the Cosmere and anyone who has even poor foresight will weaken and distort all others.
No Cosmerian magic can affect the BeyondEdit.
Edit: @Karger here how allomancy fit's into this I am working on Feruchemy