While reading, I encountered this sentence:
Dann bezahlte er und nahm die beiden Zaubertränke an sich.
Why does "an sich" appear at the end of the sentence? Is the verb here "sich annehmen"? If so, shouldn't the reflexive pronoun be beside "nahm"?
While reading, I encountered this sentence:
Dann bezahlte er und nahm die beiden Zaubertränke an sich.
Why does "an sich" appear at the end of the sentence? Is the verb here "sich annehmen"? If so, shouldn't the reflexive pronoun be beside "nahm"?
Is the verb here "sich annehmen"?
No, here it is etwas an sich nehmen. It means to take something to oneself or literally to one's body.
It's a form of "nehmen" that focuses on that now the person who took it still has it, rather than what it is.
Compare
That is because an sich is an adverbial of direction, and adverbials of direction belong into the predicate block. And that one is always at the end.
Ich habe gesehen, dass Müller im Strafraum den Ball nicht in das Tor schießen konnte.
Müller konnte im Strafraum den Ball nicht in das Tor schießen.
Müller schießt im Strafraum den Ball nicht in das Tor.
The adverbial of location (im Strafraum) precedes the noun accusative object (den Ball), as all "normal" adverbials (time, cause, mode, location) do. The adverbial of direction is special. It belongs to the predicate. It even moves with the predicate if you make it the topic of the main clause.
Nicht in das Tor schießen konnte Müller im Strafraum den Ball.
There is only ever one single item in front of the V2 verb. The full predicate block in this case.
(Of course you could also make only in das Tor the topic instead of the full predicate. That does not contradict the notion the directional adverbial is special as it can move together with the predicate.)
Dann bezahlte er und nahm die beiden Zaubertränke an sich.
Aber ich habe gesehen, dass er im Laden die beiden Zaubertränke nicht an sich nahm.
Same here.
"an sich nehmen" is the verb "nehmen" extended to a phrase that means "to take into one's possession". In contrast, "sich annehmen" means "to take care [of something, written as genitive object]".
Had it been the latter verb, the sentence would have been "Dann bezahlte er und nahm sich der beiden Zaubertränke an." which would be a bit strange: the latter part could have been short for "and took care of concocting/disposing of the magic potions". It could have been that he was haggling with a customer while in a tavern, agreeing to concoct/dispose of two magic potions, and then paid for his drinks and went to work on the potions.
As it is, he took hold of the potions after paying.
There is a verb "sich etwas [einer Sache oder eines Dinges; genitive] annehmen" (Duden, meaning 7). It means to literally or figuratively adopt some person, thing or task and care for it, or make it one's own. An example could be "er fand die Katze am Wegsesrand und nahm sich ihrer an". Indeed, the reflexive pronoun then is where you suggested it should be in such cases.
As others have explained, the same group of words can be re-ordered and simply mean "to take hold of something", as in your example: Er fand die Katze am Wegesrand und nahm sie an sich." The difference in meaning is subtle: Here, too, it can be meant figuratively, for example it could mean that he took the cat to his home, not necessarily all the time in physical contact. But it still does not imply the same level of care and commitment as the first example, "sich ihrer annehem".