A talent represents a feat, skill, or spell.
Talents are quite a thing; they're pretty much an index to an ability/spell/feat on a creature however defining them manually is no better than calling the direct related functions (eg; ActionUseFeat). In fact they're really buggy when created manually using TalentSpell or TalentFeat and don't really work properly that way; there is for instance no way to specify metamagic or what class has the spell, nor if an item is involved (yet all 3 of these can be done by the engine itself using the Best/Random functions).
Bioware only ever used GetCreatureTalentBest and GetCreatureTalentRandom, both of which are quite slow since they iterate over every spell/ability/item on the creature, so calling them too often in an AI script isn't recommended, and they are limited since you cannot iterate through them only get the best or a completely random one of a certain category. If you wondered why the Bioware AI was a bit daft in spellcasting choice this is the main reason.
Until NWN:EE talents were the only way creatures could use spell-casting items such as potions, scrolls and the like, now you can use ActionUseItemOnObject and ActionUseItemAtLocation to completely mimic player actions.
In NWN:EE it is still the only way to properly cast certain spells and abilities, due to bugs with GetHasSpell and ActionCastSpellAtObject/ActionCastSpellAtLocation, and the only reliable way to use metamagic such as METAMAGIC_SILENCE prepared spells when under the effect of silence.
talent tMagicMissile = TalentSpell(SPELL_MAGIC_MISSILE);