How does AI know if they killed a Enemy

Please I really need help :frowning: