I understood it this way. Eg: Some people pray in Jamaath to please Allah, at the same time they want to show off to other people. That would be seeking Akhirah and this world togather. But the deed is invalid since there is an element of Riya in it.