Why is it needed to do trademark search before filing?

Preliminary Trademark search is not mandatory as per law, still, it is recommended so that businesses can choose marks that are distinct and registrable. Failing which can leads to rejection of the application. It is also important to assess the likelihood of infringement at latter stage.