Understanding non-ideal voltage behaviour of cathodes for lithium-ion batteries