The first paragraph in the Description section on that documentation page states:
"You can specify A as a function handle, afun, such that afun(x,'notransp') returns A*x and afun(x,'transp') returns A'*x."
By writing a function you may be able to solve systems where explicitly creating and storing A would require a lot of time and/or memory, but A has a structure that allows you to compute its product with a vector more efficiently without needing to build A. As an extreme case, if A was eye(1e6) that would require a lot of memory to store, but A*x and A'*x are each just x.
Why does lsqr require both those products? See page 44 as well as step 3 of the algorithm on page 50 of this paper which is the second reference on the lsqr documentation page.