When an individual places a trade on an online brokerage, is it against their order book or is it against the order books of exchanges like NYSE?
Do brokerages warehouse some risk when making markets? I.e. do they collect small orders from retail and then do one large trade against the exchange?
For futures and forex trade, is individual exposure to exchange or these brokerages? I.e. if a brokerage goes under, will the contracts and long/short position still be honored by exchanges? Am I implicitly taking counterparty risk with these brokerages?
1: Depends. Some platforms allow you to choose. But generally internalization is tricky - in the USA orders must be routed to best quote on exchanges.
2: Brokers never make market. That is a market makers job. And no, aggregation is not a market makers busines either.
3: forex: what exchange? futures: contrats and customer collateral are segregated and not allowed to be mixed with the broker's operational fund. Brokers are not counterparty to futures contracts. They are for forex, though, with most brokers.
In the US. there is NBBO (National Best Bid and Offer) which is the highest available bid price and the lowest available ask price. SEC Regulation NMS requires that brokers route orders to the various exchanges, guaranteeing that customer orders receive these prices (size limited).
Traditional brokerage does not aggregate orders to be submitted for execution at a later time. Companies that manage their own DRIP plans or transfer agents hired to administer such plans may aggregate purchase orders (new cash). An example of this might be a DRIP that purchases shares on the 15th and last day of the month.
Reputable brokers in regulated countries have stringent capital requirements and must segregate client funds. There are investment compensation funds which address the possibility that a brokerage becomes insolvent. Though not asked about in your question, in the US, the Options Clearing Corporation (OCC) provides clearing and settlement services for exchange traded options, security futures and OTC options. while assessing their risk and acts as guarantor that the obligations of the contracts are fulfilled, protecting participants from counter party risk. I believe this is called Novation.