Why do attorneys have these?
Originally to use as references, although some kinds of books (e.g. case law reporters, Shepard's citations, Martindale Hubble directories, and serial analysis of case law like Am. Jur.) are rarely used that way any more.
When I started practice in the mid-1990s, it cost several hundred dollars an hour to access online legal sources (that were less comprehensive and had lower quality search functions than the service that comes free with my bar membership today), so the vast majority of legal research was done with hard copy case reporters, digests and annotated statute books.
A complete set of case reporters for a single state would typically run to hundreds of volumes with new ones arriving monthly. A full set of Shepard's Citations (which told you if a case have been overturned or questioned in later cases or just where it was cited with approval) took roughly a full shelf of a full sized book case when limited to a single state. Any law firm that is at least fifteen or twenty years old needed them when they bought them and lawyers hate to throw anything away.
Case law research is now predominantly online. The last time I used Shepard's citations and hard copy case reporters on a regular basis was a decade ago. Law journal research is also predominantly online now. I sent most of my uglier and numerous law books (including several dozen volumes of an outdated legal encyclopedia summarizing case law) to the recycling bin about six or seven years ago.
Do they actually reference them, especially when so much information
is searchable and indexed online?
Lawyers still routinely use statute books in states where they practice, court rules, standard jury instructions, and to a somewhat lesser extent treatises on different areas of the law (including the Restatements of Law). Now and then, lawyers will still use a hard copy of a West Digest.
And, I have yet to encounter a lawyer who doesn't have at least one or two decent sized book cases full of law books.
In statutes and court rules (and regulations), typesetting details that can get mangled online are important and browsing a structured text can be easier to do on paper than online. There are some regulations available only in online versions that I print for ease of use (e.g. Colorado's marijuana regulations and its Medicaid regulations). I also print for ease of use my state's title standards (for use in determining if someone has marketable title to real estate), even though they don't have the force of law. I also keep a few hard copy model statutes with the official commentary.
It can also be hard on the eyes to look at a computer screen non-stop all day, so looking at something you use regularly on paper can be a relief.
Are the books updated regularly? or are these the books they graduated
with, and are rarely changed out?
Statutes and court rules and jury instructions are typically updated annually, following each year's legislative session.
Treatises are updated with "pocket parts" every year, that are added to a hardbound edition that is updated at most, every several years. A pocket part is a softbound update with the same section organization as the underlying treatise that has a flap the fits into a pocket in the back flap of a hard cover treatise. Bigger "pocket parts" are printed as thin softcover bonus volumes to the original treatises.
I also keep a current softbound "Bluebook" (the reference regarding how legal materials should be cited to in legal documents and legal scholarship) and several high end dictionaries including Black's Law Dictionary, the OED and a few others in hard copy (because browsing is easier when you don't know exactly how a word is spelled). I keep many of my law school textbooks, which some people do, and other people don't, and I buy new treatises especially when I move into a new area of law practice where background guidance is useful.
Do the books exist purely for psychological impressions, or is there a
Sometimes old books that don't have much ongoing practical use are kept on the shelves because they are pretty. For example, I don't really need a hard copy of my outdated New York State Statutes, but they look good (even though I practice mostly in Colorado and look up New York State statutes online when I need to actually use them).
But, I use hard copy statutes and court rule books for the state where I practice on pretty much a daily basis and use hard copy treatises at least several times a week in my law practice. In that respect, I am not atypical, although I probably use hard copy books more than younger lawyers do.
Of course, even among these books, some volumes are used much more often than others. I look at a volume of insurance industry regulation statutes at most, once a year, while I read the volume related to divorce and probate at least once or twice a week, for example.
Hard copy books are also useful for pinning down the corners of blueprints and surveys when you are in litigation where those kinds of oversized paper documents are at issue. ;)