Galaxy groups from observations and simulations