Hello Han,
The difference between the first and the second sentence is that they are in different tenses, and thus express different concept.
"I visited Egypt last year." has a finished time reference, and therefore we cannot use Present Perfect, we have to use the Past Simple instead.
Here is one more example for you:
"Did you ever go to the theater when you were in Japan?"
Present Perfect always somehow links the past and the present. The use it has here is experience, which mean that the main focus is on the action, and it is not so important when exactly this action took place. Instead, it is very important whether this person has done it or not.
Another example,
"Have you ever ridden a motorbike?"
This sentence means something like "Have you ever ridden a motorbike in your life?"
I hope this helps. If you want to ask more questions, please post them here.
Best regards,
Nikita Kovalyov
http://www.eclecticenglish.com/