m4v is a raw mpeg4/10 format (otherwise known as AVC or h264) and provided the file specifications such as bitrate, resolution, profile etc, fit those required by the tv they will play without a problem.
mp4 is an mpeg container that contains either mpeg4/10 or mpeg4/2 (generally just refered to as mpeg4), again provided the file specifications such as bitrate, resolution, profile etc, fit those required by the tv they will play without a problem.
The difference between mpeg4/10 and mpeg4/2 is mainly to do with compression, essentially mpeg4/10 files are more efficiently compressed resulting in smaller files of equal quality, or indeed similar size files with higher quality.
In terms of the tv the main difference to remember is that mpeg4/2 files should have a datarate of 3 Mbps or less wheras meg4/10 files should be 5 Mbps or less.
What you really need to know is why those files that wont play, wont play. You may find that simply selecting the file in itunes and choosing advanced/create Apple tv version from the itunes menu will do the trick without you having to understand why at all. If this doesn't work take a look at the specifications for the file and post them back here where we can give further advice.
See This