She was still leading at the halfway point, but the other runners were 'gaining on' her.
She's 'gaining' confidence in herself. [=she is becoming more confident]
Some of the stocks are 'gaining' value, while others are losing value.