curve modifier problem

Recently i have tried to figure out what the algorithm of the curve Modifier. It took me a lot of time to figure out how the vertices of the mesh follow a certain curve. Does anyone know something about this?

Just be sure to put object origins to 0,0,0 - curve modifier expects this very much.
To be true, it is mush easier to use armature in envelope mode with some bendy bones to mimic curved deformations without this crazy originations stuff