In the ancient times, magicians were not entertainers just as they are now. You may know the Bible story where Moses’ miracles were counterattacked by the Pharaoh’s magicians. Before, some magicians were advisers of kings and emperors as they were believed that they see the future. This helped the Royals to make decisions and do necessary actions.
But most magicians were entertainers just like our present day’s illusionist. They were tasked to entertain the royal family and their guests as a form of entertainment back then.depending on the country, a magician was perceived as evil and a threat to the society while some were given so much importance and sometimes were hailed as heroes.