The Twili are the sedate descendants of a violent race of powerful magic wielders who waged war on Hyrule to try conquer the Sacred Realm ages ago, before the birth of Ganondorf. But just as they were about to succeed, the Gods of Hyrule commanded their Light Spirits to strip them of their magic and they were banished into a realm of perpetual twilight. The Twilight Mirror, the only link between the two worlds was then entrusted to the Sages.
The ancestral shadow magic that these ancestors used existed in the form of an artefact known as the Fused Shadow (or Crystallized Shadow). After taking it from them, the Light Spirits split it into four parts and, to prevent it from being used again, one was sealed away with its original owners (becoming a personal possession of the Twili's ruler) while the other three were enshrined each in a different temple, the care of which would be entrusted to the various races of Hyrule (the Deku Trees children, Gorons and Zoras).
While in her cursed imp form, it seems that Midna relied on her fused shadow to perform magic, but she clearly had her own magic and special abilities as ruler of the Twili. The magic of the Twili, when used, seems to be based on elaborate rune-like patterns and geometrical shapes. The curtain of twilight that separated the areas of Hyrule wrapped in twilight from the rest, for example, displays a circular pattern with lines and squares around it when Link approaches. Likewise, whenever Link would strike or run against the barriers used by shadow assassins, a similar pattern would flare across that part of the usually invisible barrier's surface. Judging by this the Twili may have a magic different in nature from any other in Hyrule, although Ganon seems to have mastered it in his collaboration with Zant. The way the Twili approach magic would appear almost scientific, mathematical even, when compared to that of the rest of Hyrule, where magic is more akin to a spontaneous expression of the will.
The eye of shadow, which seems to represent a shadow-centred outlook on the world, appropriately appears both on the throne in the Palace of Twilight and on the back of Midnas fused shadow headpiece. With small differences, the symbol has also been used by Vaati, Ganon and his alter ego Agahnim at different times in Hyrules history, and also as symbol of the Sheikah tribe (the Shadows of the Hylians) who, however, add a regretful tear to it.
As said, over time the Twili became a peaceful, harmless people, seemingly having no enemies in their world of Twilight. They lost almost all of their ambition, and no longer wanted anything to do with the light world, but they still harboured great resentment toward its inhabitants. This drove Zant, a Twili with ambitions much like his ancestors, to accept serving Ganon in conquering both worlds, so long as he could rule the Twilight in Midna's place. To this end, he transformed the peaceful Twili (and some of Hyrule's people too) in monstrous Shadow Assassins (which may have also existed and already employed when their ancestors tried to take over Hyrule if the drawings in Arbiter's Ground are to be interpreted as such). At the end of this conflict, both Twilight Mirror and Fused Shadow were destroyed.
Twisted into shadows by the Twilight Realm, the Twili come in all shapes and sizes, but are usually almost featureless androgynous black humanoid with reddish golden eyes. Originally, their ancestors may have been very similar to Hylians, as shown to Link in a vision by the Light Spirit Lanayru. When Link and Zelda finally free Midna from her curse, she looks like a tall, light gray-skinned woman with orange-red hair and slightly slanted eyes. Unlike most other Twili, her gender and features are obvious (but this may be because of her royal lineage). The Twili speak their own exotic language but Midna could still get Link to understand her. When approached the average, melancholic Twili is prone to sighing and moaning.
In lieu of a sun, the (unknown to us) Guardian Deities of the Twilight Realm, granted spheres of gentle light called Sols. These have the power of dispelling curses and transformations caused by dark magic (though of course they are not so powerful as to undo a spell cast with the power of the Gods, such as the curse on Midna). The Twili have an unexplained connection to the Twilight Mirror. Only the true leader of the Twili can destroy the mirror completely. This would prevent all travel between the two worlds. The mirror itself is evil (supposedly because it retains the malice of people banished with it), and can turn people who gaze into it in Twilit monsters. When the fused Shadow parts are gathered and united, the power of its wielder is second only to that granted by a Triforce part. However, even just a part of fused shadow is enough to turn a person from the light world into a rampaging monster. The fused shadows do not seem to have this effect on the Hero or the Twilight Princess, although Lanayru warned Link to be careful nonetheless.
As for the Twili's ancestors, it is unclear who they were and where they came from. The are said to have appeared among the people of Hyrule, but it is not clear whether they were some of Hyrules people revealed magic users or appeared from elsewhere. Because Ganondorf and his Gerudo while not belonging to the Kingdom of Hyrule were not stopped by the Gods when they went for the Triforce, it would appear the Twili's ancestors were interlopers invading the world of Hyrule (not just the kingdom). We do not know for sure where they came from, or how they learned of the power of the gods, and they may or may not, be a race we already know (considering the resemblance between the Fused Shadow and Majora's Mask, which was crafted by a long gone tribe) or even several races that formed a malicious alliance. Unless future games give us more details, their true origin will likely remain a matter of speculation.