Adaptive immunity has to be triggered by innate immune mechanisms. This takes time. However, the time can be tremendously shortened if adaptive immunity has already been triggered by a vaccine. That is the purpose of a vaccine. To give adaptive immunity a memory that an infections has been seen by the body before.