"不知不觉" is often used as "在 + 不知不觉 + 中". If you only say "不知不觉", it might be like an adv.. You can also think "不知不觉" as a situaiton (n.), so "在 + 不知不觉 + 中" means "in / within the situation of 不知不觉".
For example: "我不知不觉睡着了。"(adv.) & "在不知不觉中,我睡着了。"(n.).