Realistically, how could a parasite become sentient? It doesn't have to be one that can control it's host like a yeerk from Animorphs, but that wouldn't be a disqualifying factor.
Realistically, unless the parasite can generate and perceive radio frequency signals, and therefore communicate 'telepathically' with other members of its species, there is little reason or opportunity for a parasite to become sapient.
Parasitism typically requires that the parasite lodge itself somewhere on or in its host's body, and simply attach and begin feeding, none of which requires much in the way of brains. Since the parasite doesn't kill its host, it remains up to the host to feed itself and its parasite.
The only likely way that a parasite could become sapient is for it to evolve to use its intelligence to assist its host, in which case it is no longer really a parasite but rather is a symbiote, or for it to use some long-ranged non-line-of-sight communication method to communicate with others of its own kind to their mutual benefit but not the host's benefit. Such communication abilities are unlikely to evolve except on a world where organisms incorporate metals into their bodies.
Since parasitism imposes selection pressures minimising the impact upon the host - at least until it is time for the parasite to reproduce and have its offspring parasitise new hosts - the selection pressures are typically those encouraging simplicity over complexity, and low energy over high, and sapience is typically both complex and energetically demanding.
Intelligence came first. Parasitism came later.
Your species starts as a small meerkat-like carnivore that lives in groups - social cooperativity and intraspecies competition leads to intelligence.
A subset of this species associates itself with large herbivores. In addition to catching and eating creatures flushed out by the big grazers they clean the herbivores of ectoparasites. Some of these ectoparasites seriously decreased the genetic fitness of the big herbivores so that is a serious win for the herbivores.
Some of these creatures in addition to cleaning off parasites take a sip of blood or meat themselves. Over time this subset does less foraging and more sips of blood and meat from large animals.
This subset gradually evolves to complete parasitism of their original hosts and others. Body size decreases and they become stealthier. The intelligence evolved by their ancestors persists, but in a degraded, degenerate way.
Spreading and feeding
There is much literature and other media like games where you can see why parasites would want to get smart, even if it isn't said explicitly. This also has a evolutionary perspective, which we can actually see in nature. Like all organisns they want to spread.
Parasites exist in many forms. From fat worms that can become several meters long to viruses and bacteria. Some use existing 'biological infrastructure', like feeding, breathing or excrement, to spread. But some use some extra assistance to either protect themselves or help spread. A bacteria that uses cats to multiply can infect mice and make them lose their fear for cats. Rabies can cause fear of water to such an extent that spasms are triggered when trying to swallow. Cordyceps will influence ants or other insects to move to certain locations, grip until they die and then the fungus will grow out and spread. Each is a mechanism to control. This control is to try to spread better or for defence.
From there it really isn't a big leap for a parasite to start controlling more and more of the actions. First it might be to spread better and better, but at a certain moment the host might be more protected as well. The longer the host survives, the better it can spread. The parasite would start to improve food intake and possibly blend better into the society it works in, so it won't be rejected by other potential hosts and can stick around. The intelligence might not come from the parasite, or at least not at first, but might gain this ability at a later stage.
After a certain amount of control is established, the parasite/host organism can nearly be seen as one entity. That means that, if applicable, intelligence is the right strategy for further evolution. Meaning they can take the same evolutionary path as humans, because it benefits them.
It is a long, complex road to such parasites and they likely only infect one or two species at first. It is unlikely. On the other hand, humans getting this much intelligence was also unlikely. We see it could happen with humans, so the same could be valid for parasites.
Animal Husbandry based Parasitism
Humans used our intelligence to domesticate various animals such as goats, sheep, and cows. To these animals who we use for milk, we are by every definition parasites. In some cases, humans like those of the Steppe peoples have also been known to drink the blood of their horses while riding them.
Others have gone into detail about evolutionary factors which work against the evolution of higher intelligence in a parasite. There are still ways for parasitic life to "find a way."
Another scenario which may work in conjunction with Willk's idea. Perhaps parasitism is only one stage of the life. Or perhaps the parasite lives inside a creature large enough to provide enough calories to support the parasite's sophisticated nervous system.
The book "Parasite" by Seanan McGuire (author of somewhat schlocky urban-fantasy) has genetically engineered tapeworms doing this. Everyone has one now and they keep you super-healthy with their ability to adapt.
But in rare cases, especially for a brain injury, they can spread to the brain, "adapt" to it and accidentally take it over. Of course it's like a new brain -- they have to learn how to walk and talk, but are fast learners.