Land Grant Universities were created by an Act of Congress during the American Civil War, the Morrill Land-Grant Colleges Act of 1862. The University of California is one of these colleges, and UC Berkeley was established shortly after in 1868. Land Grants established many of the major universities in the U.S., especially in the Western States.
The land grant gave the University a great deal of land, which partially explains why UC Davis still owns such a large amount of acreage. The University sold most of its land to emigrants in the 1800s and early 1900s, raising funds to build the schools. However, UC Davis retains over 5,300 acres of land (source). The University puts the land to unique uses for a college campus — there is an airport, a Landfill, and two freeways running through campus.
The Land-Grant Colleges Act decreed that land-grant schools have a Cooperative Extension, which still exists to this day. Land grant colleges are also required to teach engineering and military science, so kicking the ROTC off of Campus may be more difficult than it sounds.
And the rest is Town History.
More info: see the wikipedia article.