1) if they had the same niche they either live in different areas of the niche due to adaptation or one of them will die due to competition with the other animal.
2) they might need to move to a different habitat due to lack of resources and the competition was better adapted to the circumstances.
hope this helps