How does this work in Kanban? I understand WIP is the maximum capacity in each swimlane but how is it estimated, is estimation done by the number of cards?
As Bart explained, it is not WIP but the WIP Limit that helps the team and the stakeholders define the maximum capacity of any workflow or value stream.
Typically, WIP Limits are defined for each stage (column) of the swim lane as the general situation is that different functions/ people work in the different stages of a swim-lane's workflow.
WIP Limits work as a constraint on the channel that is represented by the swim-lane. Thus they discourage multi-tasking and encourage Flow - the key performance metric in Lean/ Agile systems.
Most teams might start with no WIP Limits and as they understand their system's/ team's behavior/ performance, they then start to put them in. As described in this page, the great Don Reinertsen recommended during last year's Lean Kanban India conference that teams should initially observe the flow of work through their system. Once they have learned enough, they can start with WIP Limits equal to half the value of the average WIP (number of items in any stage at any given time). Most teams that I have interacted with place a WIP Limit of 1 to 1.5 cards per team member working at each stage. This is to encourage a "single-piece" flow as much as possible, but have some additional work at hand in case something gets blocked or stuck due to any reason.
While you could define WIP limits in units other than the number of cards (such as story points), the overall effort of WIP LImits is to reduce multi-tasking - helping team embers to work on one task at a time. To that extent, it is easier to define and work with WIP Limits in terms of the number of cards.
Hope this helps!
WIP stands for Work-In-Progress, which is just the number of work-items (cards) that are in a particular state (or column on the Kanban board). WIP is not estimated, but simply calculated.
In addition to WIP, there can be WIP Limits.
A WIP Limit is an agreement within a team that the number of cards in a particular state must not exceed a predetermined number. The WIP Limit indicates the maximum capacity of the team for a certain kind of work. If the WIP Limit is exceeded, then the efficiency of the team will go down, because team members need to work on multiple tasks in parallel, with the associated overhead of task switching.