Both sentences use that as a relative pronoun. The relative clauses in both sentences are defining or restrictive, hence modifying rather than parenthetical. The Cambridge Dictionary website comments:
We use that instead of who, whom or which in relative clauses to refer
to people, animals and things. We use it to introduce defining clauses
only. That is more informal than who, whom or which...
The same entry proceeds to explain that that can serve as either the subject of object of a relative clause:
That can act as the subject or the object of the relative clause:
He finally remembers one lesson that his mum had taught him early –
Don’t take money that doesn’t belong to you. (that refers to money and
is the subject of belong in the relative clause)
It’s the same cooker that my mother has. (that refers to the same
cooker and is the object of has in the relative clause)
The relative clauses in both of your example sentences are complete and well formed. The primary difference is in the role played by the relative pronoun, that. In the first sentence, the relative pronoun is, itself, the subject of the relative clause; in the second one, the relative pronoun is the direct object of the relative clause.