Lean thinking had its origin in the manufacturing industry where Toyota introduced the lean concepts in their production lines. The main factor was indicating the inventory requirements promptly when it was required rather than planning way ahead. For example, if the production line requires a batch of paint to be delivered, it is indicated on a board so that the department responsible can produce that paint batch and deliver it to the teams that required it. Just-in-time delivery reduced more than inventory space, and overheads and kept the communication clean between different departments. The same concepts applied to software development became lean thinking and helped a lot of companies to keep their overheads low and deliver more valuable software. This was in direct contrast to the waterfall approach which was popular among the industry. The waterfall approach wanted to dictate that all software requirements and all possible cases be documented before starting the development (akin to manufacturing a car). This mandated that the software is always delivered in one shot. Lean changed that thinking.
Agile is also a software development methodology that is a little different from Lean thinking but also similar in many ways. Agile prescribes certain traditions which are based on its values and principles. One such principle would be that we should value customer collaboration over contract negotiations. This means that we should be flexible to the customer's needs rather than sticking to the contract or the rigidity set in via legal teams. This indirectly prescribes certain traditions like sprints and user story planning along with a customer stakeholder in the team.
There are many similarities but also many differences between agile and lean thinking. Let's talk about them.
Both, lean and agile are relevant for software development teams. The choice of which methodology to follow would be based on how much planning the team is willing to do. If the teams are light, choose agile with minimal planning. If the teams want to be really on the edge, choose lean with more on-demand developments. But both methodologies have their place in the industry.