I notice that a lot of people seem to think like that at first, it looks like that overall, but it is really a two step process. The carboxylic acid
functions as a nucleophile and attacks thionyl chloride, a chloride ion from the thionyl is expelled as a leaving group, and then a chloride ion
functions as a nucleophile and attacks the carbonyl group. Lastly to reform that carbonyl group a leaving group is expelled which then degrades to give
SO2 gas and a chloride ion.
That second reaction is pretty much the same concept, I guess they use pyridine to stop the formation of HCl since you're probably going to have some chloride ion floating around.