Before submitting an answer to a question I first check to see if there is a notice that a new answer has been submitted. However, on more than one occasion I have been embarrassed to submit an answer which is a virtual duplicate of an answer already submitted. Also, I frequently see essentially identical answers submitted by two people minutes apart so I assume the newer poster faced the same issue.
Depending on the load on the servers, the quality of your internet connection, and other circumstances the connection for real-time notifications can get interrupted.
If this happens you only see new answers once the page gets refreshed.
If you want to be sure, you can manually induce a refresh right before you post. (Be careful not to use your work in the process though! You could open a second copy of the question-thread it in a new tab for example.) But I do not think it is necessary to go that far; it's alright to have some redundancy.
For a question about the 'etiquette' of the situation see About posting identical answers to a question