Night market started in Taiwan due to scarce commodities and poor roads in the agricultural societies. People tend to travel around and sell their goods rather than staying in the same place.
Night markets really grew in the during the late 70s they were well received due to the oil crisis. People scavenged night markets for cheap goods.
I often wander around mindlessly in these places whenever I can. The excitement of finding something good while not expecting it definitely grew on me.