William Shakespeare's play, Henry V, is loosely based on actual historical events, but also includes invented material and compresses the actual time sequence of the events.
The single most important source for the play is Raphael Holinshed's Chronicles of England, Scotland and Ireland (1587 second edition). Although this work attempted to be a reliable chronicle, and is broadly accurate, at times the work presents self-contradictory accounts of the motivations and characters of the major figures of the period. Shakespeare also made use of an anonymous play, The Famous Victories of Henry the Fifth, which like Shakespeare's subsequent work balances verisimilitude with artistic license. We do not actually have accurate historical data on the number of people involved in the battle of Agincourt. While Henry's forces were outnumbered, we do not have accurate information on the precise size of the armies nor the number of people killed and wounded., nor could Shakespeare have know precise numbers.
The time sequence of the siege of Harfleur and its proximity to the Battle of Agincourt is compressed; the siege actually lasted for several months and the Battle of Agincourt began a month after the siege. The British victory at Agincourt and Henry's subsequent marriage to Catherine are both historical events, but the battle actually took place in 1415 and the treaty and marriage in 1420, despite the two events being portrayed as occurring quite close together in the play.
The story concerning the war being caused by the French Dauphin sending tennis balls to Henry is pure invention. The causes of the war probably had more to do with economics than with honor.