Puella Magi Madoka Magica is a dark pseudo-deconstruction of the magical girl genre. In the show's setting, there are little alien creatures running around called Incubators, or Kyubey. Ruby calls the Incubators parasites, which is kinda hilarious for reasons you'll see later. They offer wishes in exchange for becoming a magical girl and fighting monsters called Witches. When a Witch dies, it drops an object called a Grief Seed, which a magical girl can use to refresh their magical powers.
When a girl makes a contract with Kyubey, they are given an object called a Soul Gem. This name is literal, and their soul is literally in the gem. This has the upside of them being resistant to body damage, but it means that when the gem is broken the girl dies. Kyubey does not tell the girls that he does this.
The magic a magical girl can use is related to their wish. A girl who wished to heal someone gets enhanced regeneration, a girl who wished for guidance gets precognition, etc.
When a magical girl uses magic, they build up a bit of corruption, or grief, in their gem, proportional to the amount of magic they used. This corruption looks like ink staining the gem, but starts going interesting colors when the gem gets covered completely. If a Soul Gem gets filled with corruption entirely, the gem breaks and a Grief Seed is created from the remains of the girl's soul. A Witch then "hatches" from the seed. Grief Seeds are used to clear corruption from girl's gems. So yes, the magical girl economy is pseudo-cannibalistic. Kyubey does not tell girls this.
Corruption is also built up by strong negative feelings, and can also have negative effects on the magical girl's psyche, which causes further despair, which causes more issues. This is has the unofficial term grief spiral, as the girl's own despair makes more of itself in a feedback loop which only ends when the girl either gets a Seed to cleanse with or turns into a Witch. Or smashes their own gem, if they know about that detail.
Witches are magical beings created of the concentrated despair of the girl that they were born from. They live in little extra dimensional hidey-holes called Barriers, or Labyrinths. The inside of the barrier is a trippy place, based off of the girl's own personal hell. For example, a girl who loves cheese has a barrier filled with sweets and candies, but not a single bit of cheese in sight. The Witch can draw people into her barrier to eat their souls or whatever it wants to do by putting them under a hypnosis spell called a Kiss. This is visible, and is marked by a small tattoo somewhere on the person's body (often the neck). In the barrier are also little monsters called Familiars, who are created by the Witch and sometimes leave the barrier. If a Familiar consumes enough people, it can become a copy of the Witch that created it.
Why does Kyubey make contracts? Entropy. The universe will eventually succumb to entropy and become a dark, cold place of nearly nothing after enough time. The Incubators found that emotions were able to magically defy entropy, but since they possess none themselves, they had to find other races to get energy from. They found that the despair of young human girls to be the most effective at entropy reversal.
The Incubators also assisted with human development in this setting. Incubators have been around for many thousands of years. The many Wishes made by magical girls slowly added up and improved the overall quality of life for all humans over time. As such, PMMM's world is rather nice looking. Mitakihara's middle school is a huge complex with glass and sculptures and heavy electronics integration, for example. The show takes place in 2011, as far as anyone knows.
Since this is a magical girl show (and because nobody would approve of the system as it is), the masquerade is in full effect.
So how does Homura factor into this? She's a time traveling magical girl, who Wished to save another girl from death. Mitakihara is scheduled to be attacked by a giant city-flattening Witch named Walpurgisnacht, or All Witches' Night, on May 1st. The girl she wants to save is Madoka Kaname, a pink-haired middle schooler who is really, really nice. Way too nice, actually. Self sacrificing to the point of possibly having a bit of a martyr complex. Homura has tried to save Madoka dozens of times, but every time she tries Madoka either dies at some point during the loop, contracts and dies fightng Walpurgis, or contracts and falls into despair, turning into a Witch. The kicker is that every time Homura tries to save Madoka, she increases the potential power Madoka has, which makes her a bigger target for Kyubey and makes the Witch she turns into more powerful. This is because of some complex stuff about how fate and multiple timelines tie into magical potential, which I won't get into here. By loop number 3 or 4, Madoka's Witch (Kriemhild Gretchen, one of many Faust references) is powerful enough to consume the world. Homura loops about a hundred times, so by the end it could probably nom on most of the solar system.
Homura's primary combat ability is time stop combined with her shield of infinite storage. She uses these to great effect, unloading oodles of firepower from stolen weaponry into her enemies from the safety of stopped time. She is the ultimate ganker, but has a weakness. Her timestop pulls any object below a certain size into timestop with her on contact, and she isn't physically strong for a magical girl. This means that she could be stopped in her tracks by a strong hug.
There are other magical girls in and around Mitakihara. Mami Tomoe, an experienced veteran (but still not as experienced as Homura) with highly versatile ribbon control powers. Kyouko Sakura, an ex-partner of Mami's who left for a nearby city due to personal issues after having a fight with Mami. Kyouko uses a segmented spear to great effect, and has the ability to create barriers of chains. One of Madoka's friends, a girl named Sayaka Miki, has the potential to contract, and if she does, she usually gets cutlasses and a healing power.
So that's the world of PMMM in a nutshell. Or not a nutshell, that's like 1100 words.
TL;DR magical girls turn into witches, witches drop seeds that clean gems when they die. Homura's a time traveller who's trying to save her waifu. Walpurgis is coming (and she's a tough nut to crack). There are other magical girls around too.