As a rule, internet services use a range of safeguards to prevent the spread of child porn, such as shared hash lists that prevent a file on one site from being posted elsewhere. It's not certain what solutions Telegram implemented, but the relatively short turnaround (its software was back within hours) suggests it didn't require a fundamental change.

The nature of the discovery might provide a clue as to how it was distributed. Telegram's bread and butter is end-to-end encrypted messaging, which should rule out a non-participant directly intercepting the messages (including Apple itself). The 9to5 team suggests that the material may have been made public through a third-party plugin. Your privacy should remain intact as a result -- Apple may have just been fortunate enough to spot the vile content and take action.