This is actually deceptively simple and I'm shocked nobody else has offered this answer yet, so here I go
Using the following for example...
$ mkdir foo
$ mkdir bar
$ mkdir ./bar/foo
$ touch ./bar/foo/file1 && touch ./bar/foo/file2 && touch ./bar/foo/file3
$ ls ./
bar/ foo/
$ ls ./bar/foo
file1 file2 file3
Now comes the magic part
$ mv ./bar/foo ./foo/
$ ls ./foo/
foo/
$ ls ./foo/foo/
file1 file2 file3
Now why does this work?
I can't give you the most precise answer as I'm just a neophyte - but I understand it comes down to how trailing / characters are treated on folders.
Look closely at that mv command
$ mv ./bar/foo ./foo/
Notice how the target folder of files is specified without a trailing /, while the destination sharing the target folder's name has been specified using a trailing /'. This is your magic ticket, and can bite you in the ass if you aren't paying attention.
I'm sorry I can't offer a more elaborate answer than that at present, but perhaps someone more fluently knowledgeable will take the liberty of editing my answer.
In any event, this would seem to be the most simple and straightforward solution, with a single use of the ls command and no creation of intermediary folders.
Hope it works for you, cheers!