Though your ads may compete with each other prior to serving, they will not compete with each other in search results, because only one of your ads can appear in a given set of search results.
If the same keyword appears in two different ad groups, which ad is displayed depends on a number of factors. The entire context of the user’s search query is considered. For example, if there are any geographic implications to the user’s search query and the campaign in which one of the ads appears has a relevant geo-targeting setting, that ad may be displayed. If all else is equal, the ad with the highest bid and quality combination should be displayed.