Reaction mechanism for reduction of nitrobenzene to aniline in catalytic and acidic media
The first reaction is called a catalytic reduction.  Here is a picture of how it works with an olefin like ethylene.



You can see that the first step involves adsorption of hydrogen onto the catalyst surface followed by dissociation of the hydrogen molecule into its catalytically active form.  The same things happen with nitrobenzene.  As the following diagram shows, the reduction passes through the nitroso and hydroxylamine intermediates.



The mechanism for the Sn\HCl reduction involves reductive electron transfer of the nitro group while the tin is being oxidized. This diagram shows the electron transfers involved



and here is the mechanistic scheme.