In the A Song of Ice and Fire novels, Lord Randyll Tarly is considered one of the best battlefield commanders in the Seven Kingdoms, a general able to read the ground, weather conditions, and how a battle is progressing with impressive accuracy. During Robert's Rebellion he inflicted Robert's only defeat while commanding the Tyrell vanguard at the Battle of Ashford. During the later stages of the rebellion he helped Lord Mace Tyrell besiege Storm's End, and bent the knee after the death of King Aerys II Targaryen. He wields the Valyrian steel sword Heartsbane in battle and is said to be utterly merciless to his foes. Although a ruthless and stern man, he is not outright sadistic, often dispensing strict justice that is nonetheless within the bounds of the law.
Randyll has always treated Sam harshly. When Sam suggested to be send to the Citadel in Oldtown, Randyll answered furiously "They make you wear a chain about your neck. If it is chains you want, come with me". He ruthlessly had Sam manacled hand and foot to a wall for three days and three nights. The chain around Sam's throat was so tight it broke the skin, and whenever he rolled the wrong way in his sleep it would cut off his breath. That experience has traumized poor Sam so much, that long time afterwards he objected (fruitlessly) to Jon's command to travel to the Citadel, although he has always wanted that.
During the War of the Five Kings, Lord Randyll commits himself to Renly Baratheon's cause, and Catelyn Stark encounters him when she visits Renly's camp to treat for Robb. When House Tyrell switches its allegiance to the Lannisters following Renly's death, most of their bannermen join them (except for essentially just House Florent): Lord Randyll follows his liege-lords, and House Tarly begins to fight on the Lannister side.
Lord Randyll treated Brienne of Tarth with open hostility while she was at Renly's camp. When he found out that several men laid wagers on the first to claim her maidenhead, he put a stop to it, but told Brienne offensively it was her fault because to his opinion women have no place on the battlefield.
In the books, while Roose Bolton was in charge of the eastern half of the Northern armies based at Harrenhal, he sent a large force of three thousand men (about a third of his command) east to attack the Crownlands. Roose had decided to betray the Starks by this point and was laying the groundwork for the Red Wedding and his subsequent takeover of the North, by intentionally killing off Stark loyalists by sending them on suicide missions. Coordinating with the Lannisters in secret, he sent his men into a trap set by a massive combined Lannister-Tyrell army, with Gregor Clegane commanding the Lannister forces and Randyll Tarly commanding the Tyrell forces. The entire Northern force was destroyed at the resulting Battle of Duskendale, all three thousand men, though a few Northern lords were taken prisoner.
Subsequently, Lord Randyll marches his army north from Duskendale to Maidenpool (east of Harrenhal, in the northeasternmost corner of the Riverlands) and easily takes the town. Unlike Gregor's Lannister men, who are more concerned with pillaging the already ravaged countryside, Randyll has his forces in Maidenpool set about fixing damage the town suffered in the war and reimposing law and order. He is very strict but not abusive, executing confirmed bandits and deserters who were raiding the smallfolk of the countryside, in order to discourage other outlaws from making further unrest.