How is sample weighting implemented? Some questions about the Smaple_weight parameter

My code is:
model = xgboost.XGBRFRegressor(random_state=831,subsample=0.81,n_estimators=167,max_depth=15,learning_rate=1,colsample_bytree=0.6,n_jobs=-1)
model.fit(X, y, sample_weight=weight)

What algorithm is used to perform the parameter sample_weight here, at which operation step is it performed, and is there a corresponding formula?

Thanks!