Hi, Mrchuffie,
The books which/that I bought were expensive.
[...] I don't understand why which (or that) are given as the object of the sentence given that the object of a verb is defined as being the thing/person that receives the action of the verb.
Complex sentences are formed by a main clause and one or more subordinate clauses. Relative clauses are subordinate clauses. Both the main clause and the subordinate clauses can be parsed as sentences.
In the sentence above, the main clause is:
1. The books were expensive.
and the relative clause is:
2. which/that I bought
The relative clause derives from:
- I bought the books.
where "the books" is the object.
When you combine (1) and (2) to form a complex sentence, "that/which" substitutes for "the books," and is thus the object within the relative clause:
- The books that/which I bought were expensive.
"that/which" can also be the subject of the relative clause, for example:
3. The books were expensive.
4. The books are over there.
When you combine (3) and (4), "that/which" is the subject within the relative clause:
- The books which/are over there are expensive.