Something happens instantly when there's no pause or delay at all before it occurs. If you fall asleep as soon as your head touches your pillow, you can say you drifted off instantly.
If an event is immediate, it happens instantly. Your parents might say they fell in love instantly, the moment they first saw each other, and you may realize instantly on the first day of school that you are going to love your history class. The adverb instantly first meant "persistently," rather than "immediately," though it soon gained this meaning. The Medieval Latin root is instantem, "pressing, urgent," or "standing near."