The water in that black P-trap will eventually evaporate, allowing sewer gases to pass and enter the house. Pour water into the pipe to refill the trap periodically.
In all likelihood, the washer was supposed to (and probably originally did) drain into that black pipe. If it's become partially clogged (possibly right in the trap from lint), you can probably snake it out to clear it and then resume using it as the washing machine drain, which will naturally refill the trap on a periodic basis.