An amalgam filling is held in by shape. That means cutting undercuts into healthy tooth so the filling has something to grip, which weakens what is left. Composite bonds chemically to enamel and dentine, so the preparation removes the decay and stops.
The trade-off is honest: composite takes longer to place, needs a properly dry field, and is more sensitive to being done badly. A rushed composite is worse than a good amalgam. Ours are placed under rubber dam where the tooth allows it, which is why a large one takes forty minutes.
Shade matching is done under daylight-balanced lighting at the start of the appointment, before the tooth dehydrates — teeth lighten noticeably within minutes of being isolated, and a shade taken at the end is the single most common reason a filling looks obvious.