Wow this potentially has a long answer!
The short answer is that it's a reference to the book "Alice's Adventures in Wonderland", which begins with Alice falling down a rabbit-hole that turns out to be extremely deep and full of magical, nonsensical stuff.
You can probably work out for yourself how that relates to taking pills!
I wouldn't say this is a common phrase in English. It is just an allusion to a book.