The Three Realms are the set of three planes in which existence is even defined. Everything, anywhere is somewhere in the Three Realms or can be defined as being a part of it, though separate continuums may have the Three Realms manifested in different ways.
The realms are shaped a lot like a mushroom patch. The First Realm is the mushroom cap, the Second Realm is the interior of the mushroom and its spores and shaft, and the Third Realm is the soil and space from which the mushrooms grow. Outer space, stars, planets, spacetime, and all aspects of the universe that astrophysicists speak of is the direct result of the Three Realms "talking" to each other, as space is all Three Realms and none of them at the same time.
The commonly believed "creation story" of the Three Realms postulates that the Second Realm was the first of the realms to exist, though its origins are relatively unknown. The Second Realm now exists, however, as the reservoir of dreams, imagination, and energy for the entire universe. From the Second Realm sprouted the Third Realm, which is home to many ethereal creatures and spirits, as well as the transient home of souls who have died in First Realm worlds. Lastly, and constantly, are the First Realms, which are home to what is commonly considered to be "reality" by physical beings who inhabit it.
In simplified terms, the purpose of these realms can be stated as "matter, energy, and infinity" or "reality, possibility, and eternity" for the First, Second, and Third Realms respectively. In addition to these however, are also many smaller subrealms such as Shinkai or Makai (The two "Heaven" and "Hell" like locations we've adapted from the Shinto religion as an archetypes). The Subrealms serve as the few bastions of order in the chaotic Third Realm, and departed souls often gravitate towards them in need of an external sense of order.
While basic essence between the Three Realms is not completely understood by human scientists, we are lucky enough to have discovered the general method: quantum mechanics. In all actuality, quantum mechanics, and the probability that it works on is actually only the visualization of such in the First Realm, as the idea of quantum mechanics as humanity knows it is actually inapplicable in the other two realms, due to physics as we know it not appearing in the same nature (though they still play a major role).