Experimental results on the ultimatum game show clearly that (1) large fractions of players offer a 'fair' allocation and (2) that unfair (but positive) offers are systematically rejected. We offer an explanation of this behavior using the 'indirect evolutionary approach' which is based on the assumption that players behave rationally for given preferences but that their preferences change through an evolutionary process. We prove that despite anonymous interaction a preference for punishing unfair offers is an evolutionarily successful strategy if players interact in small groups. This leads players to split the resource equally almost always. However, the equal split is not due to 'true fairness' (or 'altruism') but is entirely caused by the (justified) fear that unfair offers might be rejected.