The Apple Pencil (2nd generation) can be used as a writing tool or eraser and can be changed by double tapping the flat edge near the tip (See image below). This works for annotations in Documents, Plates, Flight Attachments, and ScratchPads.
Double tap the Pencil to switch between eraser and Pencil modes
When using the Apple Pencil in ScratchPads to make annotations, the default setting is the writing tool. The Pencil button will be active and highlighted in blue.
Pencil Mode in a ScrathPad
After double-tapping the Apple Pencil, it will change to the eraser tool. The Eraser button will be highlighted blue, and the tip of the Apple Pencil will function as an eraser.
Eraser Mode in a ScrathPad
When the Apple Pencil is changed from the writing tool to the eraser tool in Documents, Plates, and Flight Attachments, the Pencil button will switch from the pencil icon to the eraser icon, and the tip of the Pencil will function as an eraser.
Pencil Mode in Plates
Eraser Mode in Plates