What is the difference between department and faculty?
The distinction between "faculty," "department," and "school" depends a lot on where you are. As Peter suggests in his answer, a faculty can be a collection of "departments." However, a faculty in Germany (for instance) consists of a number of "chairs," each of which is closer to a professorship in a department than an actual "department." Thus, the faculty is effectively halfway between the American "department" and "faculty" in its function, as it combines some of the hierarchy and responsibilities of each.
The reason for having multiple subdivisions is that there are often many university functions—including personnel and budget decisions, facilities management, teaching, and so on—that can vary widely across the entire university, but significantly less among certain departments that have a similar focus. For these departments, it makes sense to combine these duties in a central administration, rather than duplicate the effort across multiple departments.
The faculty is a collection of departments. In my system we have the Faculty of Sciences, Law, Humanities, and Social Sciences. In addirions there can be Faculty of Theology, Arts, Languages, Educational Science, Medicine, Pharmacy and probably many others.
The term Faculty is known from the University in Paris already in medieval times. It was a way in which major fields distinguished themeselves from a genral body of learning. The faculties of Philosophy, Law, Theology and Medicine can be found back to the 13th century. As the universities grew and knowledge became more specialized departments started to form within these faculties and we now have the system of faculties as an administrative level in many university systems. Departments are, however, relatively modern creations from the late 19th century.
Sometimes using one word or another is seen as more prestigious or as more independent than another. In one place I was at, they made a big deal of changing their name from "Department of Computer Science" to "School of Computer Science".
Similarly, some people perceive one Faculty as more prestigious for the purposes of undergraduate recruiting. In many Universities in North America, computer science moved from "science" to "engineering" and my father perceived that computer science departments in "engineering" were more promising than those in "science" (as at the time engineers made more money and had more job opportunities than scientists). Of course, the real reason that this happens is often a question of autonomy, funding, and mutual interests behind the scenes.
In the end, the question of "For example, what is the difference of Department of Computer Science in one university, and Department of Computer Science in another university which is part of Faculty of Engineering?" is very, very difficult to answer and I would argue that the differences are much more dependent on the actual "department" than on what faculty/college/administrative area it's under. In North America, most departments (especially computer science departments) are relatively autonomous and do not rely heavily on their college for assistance - it's simply a bureaucratic layer through which funds go through.