Federal officials have said the Trump campaign hack and an attempted breach of the Biden-Harris campaign are part of an effort to undermine voters’ faith in the election and to stoke discord.