By another person
Ghost writing by another person is when someone else writes or produces any work (paid or unpaid) that you submit for your assessment. This is fraudulent behaviour and is serious academic misconduct. Both people can be disciplined for academic misconduct.
Only submit work that is entirely your own original work. It should be supported by sources and evidence that have been cited appropriately.
For another person
Ghost writing for another person is also academic misconduct for both people involved. If you knowingly write or produce any work that another student will submit as their own work, you are deliberately aiding another student to behave fraudulently. This amounts to academic misconduct
Do not write or produce any work (paid or unpaid) for another person for them to submit for their assessment.
Be careful about who you share your work with. You can't know if another student intends to copy your work.