both ice cream and cake have sugar and dairy in them. but cake additionally has frosting. frosting contains a high fat and sugar content. so, the same serving of ice cream and cake may vary a lot in nutritional value.