That means if you contribute $1000, and that is equal to 5% of your salary (salary of $20k):
$400 = 100% match = $400
$400 = 40% match = $160
$200 = 25% match = $50
$1000 = $610 match
It's basically the same as taxes; you can think of it as the marginal rate. So, for the "40% on the next 2%", that means that "first take the amount equal to 2% of your salary, and match that 100%. Then take the amount left and match at 40%, up to the amount which is another 2% of your (original) salary." Whichever contribution bracket you're in, the next dollar you contribute is at that matching percentage, and when you 'finish' a bracket you are at a known total match amount - ie, you can pre-calculate all of those levels, just like the IRS does.
So, you could reword this way:
If you contribute... Then the company matches...
0% - 2% of salary 100% of contributions
2.01% - 4% of salary 2% of salary plus 40% of (amount contributed minus 2% of salary)
4.01% - 5% of salary 2.8% of salary plus 25% of (amount contributed minus 4% of salary)
5.01% + of salary 3.05% of salary (this assumes 5% is the cap.)
These are calculated by taking the 'cap' of each range, and then adding that to the portion of the marginal range. You can think of it as buckets: while you're filling one bucket, you get that bucket's match. When that bucket's full, the portion of match you got for that bucket is fixed at that amount, and you move to the next bucket and start matching at that rate for the money that's going into that bucket.
If it helps, here is a chart of your contribution versus match. The colors denote the buckets and thus the marginal rates, but are not otherwise meaningful. At any point in the line you can see your contribution (on the bottom, x-axis) and the corresponding company match (on the left, y-axis). You can see in the red section, for example, that the slope changes - after 2% your company matches only 0.4 times the value of your contribution from 2.01% to 4% of your original salary.
If you're contributing in a green section, then your company match is 100% of what you contribute. If you're in the red section, then your company match is 2% of your salary, plus 40% of your contribution over 2% of your salary; so your marginal rate is 40%. This means that the next dollar you contribute will earn $0.40 from your company match. In the blue section, you earn 0.25 for every dollar you contribute, above and beyond 2.8% of your salary.