The practice is old. Section 20 of the Doctrine and Covenants, from 1830, gives the teacher the duty to watch over the church always and to visit the house of each member, and some form of assigned visiting has existed ever since. Through most of the twentieth century it took two separate forms: home teaching, in which pairs of men visited assigned families monthly and delivered a prepared message, and visiting teaching, in which pairs of women did the same for assigned women. Both were counted. A ward reported its home teaching percentage monthly, and the number was watched.
The counting is what eventually broke it. A monthly visit that has to be recorded produces the phenomenon every Latter-day Saint of that era can describe, the visit made on the last evening of the month so the number could be reported, and a system in which the measurable thing displaced the intended thing. In April 2018 the church announced that home teaching and visiting teaching were discontinued and replaced by ministering, that the monthly visit requirement and the percentage reporting were gone, and that the prepared message was no longer required.
The change was small on paper and large in practice, and members of long standing describe it as one of the more candid institutional admissions the church has made about itself: that it had been measuring the wrong thing for decades, and that the measurement had begun to produce the behaviour it was supposed to detect.