Distributors are marketing departments with a warehouse.
The base level setup is that the distributor functions as a bank or credit facility for the manufacturer, and also serves as inventory storage and shipping.
The first half of the above statement is particularly valuable for smaller manufacturers because the reality is that most integrators are slow to pay, and many of the smaller ones can be a credit risk. If I sell a product through a distributor, even in a drop-ship situation, the distributor is going to pay ME in 30 days, even if the integrator who bought that product ultimately goes under before paying his invoice from the distributor. This is an extreme case and rare, but it illustrates the point. I can sell product to credit-risky integrators without absorbing any of that risk. What I lose is roughly 5-10 points, because the distributor has to make HIS money, so I tell to him for less than I'd sell to you.
Most distributors also have multiple locations and large warehouses, so I can store my inventory with them for "free" (again, free is relative because I'm losing margin selling through distribution), and that saves me on having to rent my own office or warehouse space. It also reduces the number of people I need on my staff because I don't have to have people that "Pick pack and ship" boxes. I'll probably also see a net cost-savings on shipping, which I can pocket to make up for that 5-10 point spread, or pass on to you.
This lets me focus on building and selling my product, without having to worry about some of the less-fun parts of business. I won't need as many accounts receivable or collections people, I won't need as many inside sales/order takers, I won't need as many warehouse people. I can typically cut 4-10 staff, depending on the overall size of my operation, by using a distributor, plus I'll get paid for orders quicker and with less hassle.
If we just stop there you can see some benefits. I still have to "sell" my product, if I'm not doing my own sales and marketing orders aren't going to magically pop-up out of the blue, distributor or not (though the distributor will often try to convince you they "create" demand). The distributor is also making fairly slim margins here.
This is why I say they are a marketing department with a warehouse. What the distributor is really going to want me to do is "sponsor" a lunch-n-learn, or a webinar, or a counter-day, or a page in their catalog, or all of the above. They will also offer me the option to buy or rent a spot in their trade-show booth at ISC West/ASIS/etc. Basically the distributor will hold and ship my inventory and collect payments for the 5-10% discount, but they would prefer I work with them to "create demand" by spending money on marketing programs and tradeshows. This will tend be about $10,000/year on the low-end (to get anything worthwhile) to upwards of $50,000 on multiple programs, a lunch-n-learn roadshow at several locations and so forth. This is (IMO) where they make more of their money. Get the manufacturer to drum up demand THROUGH the distributor, and then also make money on the core part of their business shipping the product and collecting money.
Integrators like to buy from distributors for various reasons, though in my experience they technically prefer to buy direct from the manufacturer if possible and practical. If you're a newer outfit, or have shaky credit you might find the distributor more willing to work with you than the manufacturer. For products that are stocked at local warehouses there can be benefit in the ability to walk-in and pick something up vs. waiting for a shipment (especially for warranty work). Because most jobs end up incorporating multiple things (cameras, cable, mounts, etc.) it can be handy to place a single PO with the disti and pick everything up together. It's also nice for job-tracking to be able to assign Job #'s to POs and then a 1-page total for the job at the end to know exactly what you bought for that job.
Some manufacturers sell ONLY direct to integrators, some sell ONLY through distributors and some sell through both channels. There are pros and cons to all scenarios and I think it depends on how you want to position your product, who your target market is, and what parts of a company you do or don't want to build.