The speaker is talking about something, but the points or factors have nothing to do with each other or have no causal relationship , then the listener uses 这哪儿跟哪儿啊? to mean that he can not get your point or what u r talking about is sort of ridiculous.
EXAMPLE:
1. A : 你吃过午饭了吧? have u had your lunch?
B: 是啊。 Yes , I have.
A: 怪不得今天天气这么好。 no wonder today is a good weather day.
B: 这哪儿跟哪儿啊....
TIPS:
1. we normally use 这哪儿跟哪儿啊 in the oral Chinese.
2. 这哪跟哪啊 can also be used. And when you pronounce it , you can add 儿 to make it sound more like northern accent.
3. 这什么跟什么啊 has the same meaning of it. This is more like ' what is what ' .
4. advanced idiom :
这简直就是关公战秦琼. This is 关公 fighting against 秦琼!
关公 and 秦琼 were the famous warriors in ancient China, but they were in different
dynasties. So it means what u r talking about is quite ridiculous.