I am not an expert on kernel internals but I think when the partition is mounted the file system type is remembered, so the when a read() or write() call is issued, the kernel starts at the end of the filename and strips it until it finds a mountpoint
(/home/foo/bar/baz/qux.c is in
/home/foo/bar/baz, not a mounted fs,
/home/foo/bar, not a mounted fs,
/home/foo, not a mounted fs,
/home, hey that's a mount point for a partition)
,then it looks up the partition or loopback connected to that mount point, looks up the filesystem and issues the right command.
You might be interested in
this and
this.
IBM has a lot of good articles on the structure of Linux in its 'Anatomy of' series, so try looking there and in Google before asking.