The very short answer is that the Sarlacc gains energy from digesting non-sentient creatures (womp rats, eopies and so forth) and then uses that energy to torture its sentient victims, gaining a measure of telepathic enjoyment from their agony.
In fact, it likes their pain so much that it expends energy in keeping them alive so that it can keep torturing them almost indefinitely.
The mature Sarlacc, however, does have mobile tentacles and legs but
has adapted its legs as anchor roots. Scientists currently believe the
Sarlacc is an animal, much like sponges and anemones are animals.
Because it lives in the middle of the desert, the Sarlacc does not
feed often, but because of its highly efficient digestive system, it
doesn't need to. Its body preserves food for incredibly long periods
of time, digesting it slowly and storing it until the Sarlacc needs
nourishment. Unfortunately, the victim often remains alive for much
of the time, in part sustained by the Sarlacc's internal nutrients.
One of the prevailing rumors about the Sarlacc is that the creature
is mildly telepathic and actually gains knowledge and sentience from
victims as it consumes them, sometimes over thousands of years,
depending on the species of the meal. Some data Senior
Anthropologist Hoole secured from the bounty hunter Boba Fett have
Fett's helmet recorder was running, apparently, during a period in
which he was trapped inside the creature. When I sat down to study the
tape, I was horrified. Not only was it clear to me that the Sarlacc
was sentient, but it enjoyed torturing those it was digesting. Fett's
actions and responses plainly indicated that the creature manipulated
the thoughts of its victims, and even kept their intelligence stored
in its memories so it could savor their pain at another time.
The recordings also showed a more anemonelike physical structure than
most scientists have believed, and the secretion of some digestive
enzyme that might be the cause of their hallucinogenic power over
their victims. This theory was supported by the fact that Fett could
plainly be seen reacting to stimuli that were not there.
The New Essential Guide to Alien Species