My fish people live in underwater nations. They look like a mix between the Creature from the Black Lagoon (left)
and the sea creatures from Luca:
with the exception of some minorities that resemble fish more than people.
In general, my fish people are humanoid, have fins to breath like fish, have sharp, human-like teeth, have green or blue scales, and also have human lungs to breath above the water.
However, there is one problem I face. In my world, there is evolution for most of the fictional fauna. I am trying to figure out how could the fish people evolve to be humanoid, instead of being like whales and dolphins. For the particular details:
The fish people have opposable thumbs
They communicate and can understand audible language
They are able to build and have underwater kingdoms
While they wear some form of clothing, their soldiers definitely wear lots of armor
They can walk on land, and are upright and bipedal
They are able to both breath underwater and breath above-water
Some are born with tails for swimming, others are not, and are more land-oriented
My question: What physical and environmental conditions could cause my fish people to evolve into humanoids, instead of evolving to be like whales or dolhpins?