The batting side have only lost a wicket or two and there are just a few overs left in the day's play when another one falls. In such circumstances the captain of the batting side will often send in a lower-order batsman instead, rather than risk the chance of another of his better batsmen being dismissed before the close of play. This 'lower-order batsman', very often a bowler with a good defensive batting technique, is known as a nightwatchman, because his job is to see out the day's play, not necessarily by scoring runs but by taking as much of the strike as possible to protect his partner and to keep wickets intact. What happens to him the following morning is not usually considered to be of much consequence since he is not expected to score very highly anyway!
Some nightwatchmen go on to confound that last expectation. In the first Test against New Zealand , at Edgbaston in 1999, England fast bowler Alex Tudor was sent in as nightwatchman and was still batting when England won the match next day by seven wickets. Tudor finished on 99 not out - the highest ever score by an England nightwatchman