A. Reduce the number of open apps running in the background. Double-click the home button (or swipe up from the bottom on newer models) and swipe away apps to close them.
B. Adjust the Apple Pencil settings in the iPad settings menu. Go to Settings > Apple Pencil and ensure that the settings are optimized for performance.