When drawing a path B with the pen tool, is there a way to automatically merge with another path A, when I’m adding a vertex on path B that is at the same position as path A?
Using the pen tool you can click an end point to join it to any path you are currently drawing. If your vertex ends in an anchor point, simply clicking that anchor point while drawing with the pen tool will connect it to the active path.
If you have two separate, disjointed, path segments you can use
Object > Path > Join to join open anchor points of separate paths. Whether or not this is easier than clicking an anchor with the pen tool is dependent upon the artwork itself.
If, by chance, you are seeking to join a path to the middle of another path, that is not possible. All anchor points have an in and an out. You can only ever have two path segments connected to any anchor point. And at no time can you connect a path to the middle of another path segment or connect three path segments to the same anchor point.
In all respects, there is absolutely no "automatic merging" of paths or points in Illustrator. The only existing options with such merging is by using tools such as the Blob Brush, but there's nothing with relation to paths.