A Dyson sphere is a giant shell surrounding a star, allowing a technologically advanced civilization to achieve two objectives. First, by harvesting all the energy emanated by their sun they can satisfy their colossal energy needs. Second, the shell provides millions of times the surface of their home planet to live inside, putting an end to their population problems for a very long time.
The Dyson swarm is a way to work around the impossibilities of the sphere. There isn’t a material strong enough to build the shell, based on the current laws of physics. Also, we have no idea how to generate artificial gravity to prevent people inside, and anything that's not attached to the shell, from falling over towards the star.
Both problems are solved by replacing the shell with huge numbers of freestanding rotating habitats. As we build more and more of these megastructures, organized in rings around the Sun, we get closer to capturing its entire energy output to power our entire civilization.
Billions of rotating habitats will add to millions of times Earth’s surface, providing comfortable living to quintillions of human beings. Just like building a campfire, we start small—with resources from mining asteroids, the moon, and mercury. The entire world’s population could be lavishly housed in less than 400 of these habitats.
The sun not only releases unmeasurable amounts of free energy, it also a contains more than enough construction materials to build an entire Dyson swarm—and they might be easier to extract than we think. For more details you can check the spoilers section, or start reading K3+