After you have responded to a SMS or MMS message three times, or have added the sender to your Contacts, SMS and MMS messages from that sender will not be filtered as an unknown sender.
For Messages Users in India
SMS Filter is enabled by default to help users organize their messages. Using on-device machine learning, English-language messages from unknown senders are sorted into two subcategories: Transactions or Promotions. SMS Filter does not send any content or data from Messages to Apple. You can disable SMS Filter at any time by going to Settings > Messages > Unknown & Spam, and selecting “None” from the list.