"We give them food."
Translation:हम उन्हें खाना देते हैं।
Sure, so like I said above, उन्हें is 'to them', that's in the sense of 'give sweets to them'.
Wikipedia describes the dative better than I could as being used 'to indicate the recipient or beneficiary of an action' - it needn't be a 'to' preposition in English, but it's any case (no pun intended) where there's some kind of giving or other movement torward the receiving noun. That noun is then in the dative case. If that noun is वे in Hindi, and plural, then it's उन्हें।
उनके takes a bit more breaking down - it's an 'inflection' of उनका, which is itself the plural genitive case of वे.
So, starting there, उनका in it's various inflections means 'of theirs' - remember plural - marking something possessed-by or originating-from them. 'Their coat', 'their children', 'their car', 'their morale'. (Where 'their' is refererring to plural people here.)
उनके is used for 'their' when the object being 'possessed' is itself in the direct case, and masculine, and plural - 'their sons are tall' - or in indirect cases (vocative or oblique) regardless of whether the object is singular or plural, but is masculine - 'give sweets to their son(s)'. (That's oblique, a vocative example is hard to contrive... 'James & Mary, were my great friends; their son - you shall be too', perhaps... I'm not confident in that. But hopefully you get the idea.)
Hope that helps!