Per https://www.yeshiva.co/midrash/11477:
The obligation rests on the father of a boy who is the first-born of his mother and was born through natural delivery. If the father is a cohen or a levi, or if the mother is the daughter of a cohen or a levi, there is no mitzvah of pidyon haben. Since pidyon haben is dependent on the boy being the first-born of his mother, her pedigree is taken into consideration concerning whether there is a requirement to redeem her son (Bechoros 47a).
My understanding of the reasoning behind a pidyon haben is that the first born we’re originally supposed to serve with the Kohanim in the temple, but after the sin of the golden calf they were substituted by the Leviim. We redeem first borne from the Kohanim to purchase them back.
Per this understanding though, the first born of a bas Kohen born to an Israelite father should need to be redeemed, as due to his being a first born he should be serving, but due to his being an Israelite he wouldn’t be.
I see in Bechoros the rabbis use a drash to explain that this is not the case, but it doesn’t fit into my understanding of the ta’am of the mitzvah. So how does the halacha fit into the ta’am?