English has two distinct meanings of "that", with different syntax. So for syntactic purposes I find it easiest to think of them as coincidental homophones (they just happen to look like each other by random chance), even though that's not historically true.
The first version, as you mention, is a complementizer. It takes a full sentence (a TP or an IP or an S or something else depending on your theory), and turns it into a complement for a verb, as in "I know that penguins are good".
The second version is a pronoun, as in "I see that".
The way a sentence like yours is generally analyzed, it has an "invisible complementizer" (shown with ∅ here), and the relative pronoun starts out exactly where you'd expect a normal pronoun to go:
Then "that" moves up to a position right under the CP:
This movement is very similar to what's seen in WH-questions ("I wonder which apple my mother bought"), so the two are usually analyzed as being different forms of the same phenomenon. If you want to learn more, look into the term "WH-movement".