Cosmology (physical cosmology, to be precise) is the scientific study of the structure and evolution of the universe as a whole.
Modern cosmology took off in the 1920s. Albert Einstein published his general theory of relativity in 1916. Before Einstein, time and space were more or less considered an eternal and unchanging stage on which events played out. General relativity revealed that the time and space are in a sense mixed together, and that the structure of this spacetime both affects and is affected by the motion of mass in the universe.
In the 1920s Edwin Hubble proved that the "spiral nebulas" known in the sky are actually far outside our own galaxy, and must therefore be entire other galaxies rather than some kind of interstellar matter clouds in our own. The galaxies in every direction also look similar (statistically), suggesting that the universe is isotropic and homogeneous (similar in its contents and laws of physics in every direction). The assumption of an isotropic and homogeneous universe is known as the cosmological principle, and is the main axiom of physical cosmology. If it were not true, and distant parts of the universe could be radically different in terms of structure or physical laws, we would be unable to reason about the universe as a whole, based on the physics we know.
It was also noticed that other galaxies move away from us. It turns out that the farther away a galaxy is, the faster it is moving away. This relationship between distance and velocity is known as Hubble's law. Since every distant galaxy, in every direction, moves away from us, the simplest explanation is that the universe as a whole is expanding, making the galaxies move away from each other. Nearby galaxies do not move away since the local galaxy group is bound by gravity strong enough to resist drifting apart due to the expansion, but other galaxy groups move away.
Einstein's equations, when applied to an entire universe did not permit a stable solution, but only a growing or shrinking one. Einstein originally thought this a flaw and added an ad hoc term in the equations to counter it. After the expansion of the universe was discovered, the term was removed and Einstein called it "his biggest mistake".
If the universe is expanding, it must have been smaller in the past, all the way down to a single point. This theory became known (at first derisively) as the Big Bang theory, as the early universe must have been very hot.
The alternative was the steady state theory, in which the universe was thought to be expansing, but new matter forming "to fill in the gaps", as it were. In this case the universe could have been expanding eternally both in the past and future without ever having been compressed into a small volume, and never really changing.
As looking into the distance also means looking into the past, if the big bang theory were true, we would eventually see into the small and hot early universe if we looked far enough. In a sense, this is what we do, when we observe the cosmic microwave background (CMB). This is radiation which was left all over the universe when it finally became transparent in its early days (see below).
As distances in the universe expand, electromagnetic waves travelling through the universe stretch out, becoming less energetic. Visible light shifts into the redder end of the visible spectrum. Because of this the effect is known as cosmic redshift (there are other causes for redshift).
The CMB was originally thermal radiation emitted by the very hot plasma which filled the young universe. When the universe cooled down and became transparent to this radiation, it continued on, filling the universe in every direction, redshifting into longer wavelengths until now it is detected as millimetre-scale microwaves.
The CMB is strong evidence for the Big Bang as opposed to the steady state theory. Combined with other evidence, the steady state theory is now abandoned.
In the late 1990s, it was discovered that the expansion of the universe is actually accelerating. This was somewhat unexpected as it requires some kind of previously unknown effect which counters the force of gravitation slowing down the expansion. This has led to the cosmological constant being added back into Einstein's equations, this time in a way that makes the solution universe expand in an accelerating way.
Here I present a timeline of some significant events in the history of the universe so far. Many things are omitted, see e.g. this article for a more detailed timeline.
Beginning to 1e-43 seconds: beyond the scope of current physics. This time is so short and the universe so dense that our modern physical theories essentially break down.
After 1e-30 seconds: the cosmic inflation happens. The universe grows in size by a vast amount in a very tiny amount of time. This is required to explain some observed features of our universe, notably its level of homogeneity.
After one millionth of a second: A vastly long time has passed compared to the previous points. Protons and neutrons, the particles which form atomic nuclei, are formed. The relative difference in time compared to the previous step is like the lifetime of the universe so far compared to a hundredth of a picosecond.
After about 1 second: Again a million times the previous time has passed. Electrons are formed. They will later combine with the protons and neutrons to form atoms.
After about 10 minutes: the protons and neutrons combine to form atomic nuclei, mostly light elements like hydrogen and helium. The universe is essentially filled with very hot plasma and radiation.
After about 380 000 years: the universe is cool enough for the electrons to combine with the nuclei. At this time the plasma is replaced with neutral gas, which is transparent to radiation. The cosmic microwave background is the last radiation emitted by the hot plasma before this happened. When we observe the CMB, what we see is essentially the plasma in the universe before that. Therefore this is also the earliest part of the universe that we can directly observe.
During the first 1 billion years or so: The gas in the universe collapses to form the first stars, which are heavy and burn out very quickly, producing heavier elements into the universe. The gas also starts to collapse to form galaxies and galaxy clusters.
After 9 billion years: Our own solar system is born out of a collapsing cloud of interstellar matter.
After 13.7 billion years: The current moment.