Timber warehouses and wholesale distributors are the main sources of materials for builders, but the products they offer vary. Sawmills provide around three-quarters of builders with lumber, plywood, OSB, and house wrap. They also supply reinforcement, molding, and carpentry to more than half of the contractors. There are many large supplier companies in every city that you can find by searching on Google.
Home Depot and Lowes also cater to smaller contractors with bulk orders. Large supplier companies allow anyone to place an order, although the size of the order may be a factor. For example, one of the largest commercial suppliers of residential building materials in the New York metropolitan area is &. Some suppliers have a scale, with greater discounts for high-volume contractors. If you act as your own general contractor, you will need to arrange for the purchase and payment of a wide range of materials. Every city I've worked in has a private logging company and that's usually who contractors will deal with.
For some things, or because of location, builders will deal with the big retail chains, but even there the builder will usually get a contractor discount due to volume and repeat business. Having worked for a contractor for a long time, I know that larger contractors try to avoid Lowes and Home Depot as much as possible. I would like to add that a contractor or subcontractor would normally purchase several materials from several specialized suppliers.