How does Sales order and Receipt Backflush allocates the stock quantity?

Stock is allocated in case stock is issued/moving out of system. Stock is allocated when the transaction is only saved but not confirmed.
Kindly note that once the transaction gets confirmed, it gets deallocated and stock is deducted from stock quantity.
In Receipt Backflush, The products added in details form are allocated in stock if the Backflush transaction is created/saved but not confirmed.
In case of Sale Order, Stock is allocated during posting , when allocated option is selected or through manual stock allocation .