The other answer I gave did not say Why he got it. I hope this one will>
It was while serving as a private in Company D, Third Iowa Cavalry, that James Dunlavy performed a deed which entitled him to recognition as a brave and gallant soldier, and proved him equal to the demands of war as well as of peace. On the 25th day of October 1864, single handed and alone, while suffering from a severe wound in the right arm caused by a missile thrown off from a bursting shell, and while riding a horse which had been wounded by the same shell, Dunlavy captured and received the surrender of the Confederate Major General, John S. Marmaduke, at Osage, Kansas. This feat is unique in that it is probably the only instance in recorded history of the capture of a Major General by a private soldier on the field of battle.