# Is Mann Whitney U test appropriate for samples of really different sizes and distribution?

A Mann-Whitney U test on two samples of different sizes (Group A: 170,000) Vs. (Group B: 200), different distribution shape (as per Kolmogorov-Smirnov Tests ks.test in R), and comparable medians of GroupA: 0.63 vs. GroupB: 0.5 showed that these samples are significantly different (P-value <0.05). My understanding was that the Mann Whitney U test, if two samples differ in shape of their distribution, the two data sets are significantly different. However, boxplots of two (orange and green) shows one being completely within of another. Is this because of the difference in sample size which causes power to be lower?