Oh! A question I can actually answer. So, as I'm sure you're aware, Japanese society was divided into four classes- samurai, peasants, artisans, and merchants. However, these four classes weren't divided by their actual wealth, but by the Confucian idea of "moral purity":
Samurai were the leaders of society, the wise, educated, and noble guides for those below them. As such, they are placed at the top.
Peasants were next, as the food that farmers produced sustained the whole of society, while the land tax exacted on farmers' property produced much of the daimyo's revenue.
Artisans were third on the ladder. While they also produced goods essential to society, their goods were considered less necessary than the farmer's food, and they owned no land that could be taxed.
Finally, you had the merchants and traders. Edo society didn't look highly upon them, viewing them as parasites who profited off the work of others without making anything themselves. This didn't stop many merchants from becoming richer than some samurai families.
This system wasn't rigidly enforced until the rise of the Tokugawa Shogunate- up to that point, many peasants, artisans, and merchants could take up arms, distinguish themselves in battle, and become samurai (see the case of Toyotomi Hideyoshi). The Tokugawa Shogunate, among other things, began to enforce this system much more strictly, restricting merchants and artisans to specific sections of the city.
Again, class had little to do with actual wealth- many merchants grew wealthy and powerful under this caste system, and poor samurai were often not much better off than peasants. Still, the idea imposed a sort of order on Edo society by giving each class a certain set of privileges and responsibilities.