The explanation is very simple but probably not very satisfying. Nouns can be modified by a lot of random Japanese, but this grammar point is not trying to explain relative clauses in general. It’s only showing a specific type of relative clause because we can’t learn everything in one go anyway.
As for why it’s only focusing on these two, I can only guess, since the grammar point itself doesn’t explain a whole lot and the examples aren’t even full sentences. But my guess would be that it’s because these two forms can express a state rather than just actions in the past (-た) or actions in progress (-ている). The “friend who buy pants” sentence doesn’t fit that scheme.
To elaborate, while -ている expressing an ongoing state becomes a pretty big topic at some point in most textbooks, the same cannot be said about -た expressing a resulting state. I guess there’s usually a way to fudge things so that the past interpretation works in main clauses, but if you think about it, 疲れた for example usually doesn’t just mean “I got tired at some point in the past”, but rather “I am tired now”.
In relative clauses this is more common. For example, a 借りたもの isn’t only a thing I borrowed in the past. It could also just be things I borrow in general (with the -た form expressing the resulting state of me borrowing them). 借りたものは必ず返します “I always return what I borrow” is not describing things I borrowed in the past. It’s describing things that are in a state of being borrowed, regardless of when I borrow them.
At least that’s what I think would be useful to learn from this kind of grammar point, regardless of what else we can do with relative clauses.