The contribution is determined by weighting. AB for AVG, PA for OBP, and IP for ERA and WHIP.
For example Ichiro's .350 with 680 ABs is worth a lot more than a .350 from Bonds with 400 ABs. If a team averages 550 ABs and a .290 AVG for the remaining 8 players in a lineup, here's how it breaks down:
With Ichiro:550*8+680 = 5080
680/5080 = 13.386%
.290*(1-.13386) + .350*.13386 = .298032 team AVG
With Bonds:550*8+400 = 4800
400/4800 = 8.333%
.290*(1-.08333) + .350*.08333 = .294998 team avg
Under these scenarios, Ichiro's AVG is worth approx 3 points more than Bonds', even though their AVG is the same.
EDIT: apparently I type numbers a bit slower than some
