I know that Kruskal Wallis test can be used to compare median of two or more groups (e.g. see this link: https://www.statisticshowto.datasciencecentral.com/kruskal-wallis/ ), and that Mann-Whitney U test can be used for two groups.
My question is: Can we use Kruskal Wallis all the time? It can do what Mann-Whitney U test does (when comparing two groups). If the answer is yes, then why don't we just discard Mann-Whitney U test, i.e. why does Mann-Whitney U test exist?