Everyone who wants to know about how transaction replication works and how to improve the performance of transaction replication must read a great blog :
log reader read the transactions(Changes) with sp_replcmds, for xp_replcmds.
then log reader writes into distributor database using sp_MSadd_replcmds
Distributor reads commands using sp_MSget_repl_commands
Distributor writes command to subscriber using sp_MSupd, sp_MSins, sp_MSdel stored procedures
Log reader and distributor keeps the history at distributor database with MSlogreader_history and MSdistribution_history tables.
This is very important information everyone should know.