How can there be decimal subscripts in a molecular formula?
First of all, in chemistry two types of formulas exist: structural and empirical. A structural formula shows the way atoms are connected. An empirical formula only summarizes atoms and their ratios. While often an empirical formula references a molecule, there are cases when the compound in question is not molecular, or it is unknown if it is molecular. In that case, since the total number of atoms in the molecule is undefined, the empirical formula may be scaled by any number, and as long as all indexes are scaled by the same number, it will denote exactly the same information.

So, formulations like $\ce{Ti_{0.9}O}$, and $\ce{Ti9O10}$ denote the same thing: a Ti+O phase with Ti/O ratio 0.9. Usually in such cases, if ratios are fixed, corresponding indexes are kept integral. So, it is  $\ce{Al2O3}$ because the Al/O ratio is fixed here, but $\ce{Li_{0.2}MoS2}$ because the Li/Mo ratio here is not.

Returning to the $\ce{Li_xFePO4}$ issue: in this phase $\ce{FePO4}$ part forms the host network similar to quartz and thus has a fixed composition. However, Li may and does migrate in and out of the host network, so its amount in the bulk is not fixed. This is possible because Fe ions have a lot of free orbitals and some of them have rather low energy, so Li electrons are passed to iron and the small Li ions may travel through the host network. Thus the composition of the electrode changes through the charge/discharge process.

In accumulator chemistry electrodes are rarely forced towards full transfer of traveling ions, because it may lead to irreversible degradation in the electrodes. For example, the $\ce{LiCoO2}$ phase would collapse if all or even a major part of Li left, so never is all or even a major share of the Li allowed to leave it. Consequently, Li-ion battery electrodes typically contain a significant amount of Li both in the fully discharged and fully charged states.

Similarly, it's usually technically impossible to achieve complete transfer even in more traditional batteries because the voltage and consequently the travel speed of ions between electrons falls down with discharge.