How does the body count time in the short term?
Detection of rhythm is a separate function from general musicality, but both can be affected by the same brain damage, or they can be independently affected:


  A range of rhythmic deficits has been described, including the inability to reproduce rhythmic patterns or to discriminate between them, and the inability to perform music rhythmically, or to keep time to music, including dancing in time. These deficits may occur in combination with other musical deficits, such as impaired vocal and instrumental skills ... rhythmic and metric organisation can be differentially impaired in brain damaged patients, supporting the relative independence of functions of the rhythmic system. In terms of cerebral lateralisation, Peretz and Morais [43] suggested that metric organisation may be ascribed to the right hemisphere, whilst smaller rhythmic groupings are encoded by the left hemisphere. ... Neuropsychological studies of groups of patients, however, have generally shown more variable lateralisation effects, particularly in recent research [25,36,46]


--Modelling rhythmic function in a musician post-stroke

So it seems that the detailed neuroanatomy and function of rhythm isn't completely understood, but it is a fairly specific function.  One suggestion is that it's  linked to language ("We conclude, then, that this effect is linked to language dominance and not handedness." -- Rhythm and dominance), but I don't know how widely this is accepted.  Possibly Common neural mechanisms for explicit timing in the sub-second range. offers more insight, but I don't have access to the full article and the abstract isn't very helpful.